public static void setCurrentTheme(MetalTheme t) { PgsLookAndFeel.setCurrentTheme(t); }
public static void drawVerticalBumps(Graphics g, int x, int y, int height) { int loops = height / 6; for (int i = 0; i < loops; i++) { g.setColor(PgsLookAndFeel.getControlShadow()); g.fillRect(x, y + (i * 6), 2, 2); g.fillRect(x + 3, 3 + y + (i * 6), 2, 2); g.setColor(ColorUtils.getTranslucentColor(PgsLookAndFeel.getControl(), 180)); g.fillRect(x + 1, 1 + y + (i * 6), 2, 2); g.fillRect(x + 4, 4 + y + (i * 6), 2, 2); } }
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); if(column == table.getColumnCount()) { setBorder(new PgsBorders.Generic(new Insets(0, 0, 1, 0), PgsLookAndFeel.getControlDarkShadow())); } else { setBorder(new PgsBorders.Generic(new Insets(0, 0, 1, 1), PgsLookAndFeel.getControlDarkShadow())); } setBackground(PgsLookAndFeel.getControl()); return this; } }
public void paintIcon(Component component, Graphics g, int x, int y) { JButton c = (JButton) component; int iconWidth = getIconWidth(); g.translate(x, y); g.setColor(c.isEnabled() ? PgsLookAndFeel.getControlInfo() : PgsLookAndFeel.getControlShadow()); if (iconPaintPressed) { g.drawLine(1, 3, 1 + iconWidth - 3, 3); g.drawLine(2, 2, 2 + iconWidth - 5, 2); g.drawLine(3, 1, 3 + iconWidth - 7, 1); g.drawLine(4, 0, 4 + iconWidth - 9, 0); } else { g.drawLine(1, 1, 1 + (iconWidth - 3), 1); g.drawLine(2, 2, 2 + (iconWidth - 5), 2); g.drawLine(3, 3, 3 + (iconWidth - 7), 3); g.drawLine(4, 4, 4 + (iconWidth - 9), 4); } g.translate(-x, -y); }
if (model.isEnabled()) { gfx.setColor(PgsLookAndFeel.getControlHighlight()); gfx.fillOval(x, y, controlSize, controlSize); if (model.isRollover()) { gfx.setColor(PgsLookAndFeel.getGlow()); gfx.drawOval(x + 1, y + 1, controlSize - 3, controlSize - 3); gfx.setColor(PgsLookAndFeel.getControlDarkShadow()); gfx.drawOval(x, y, controlSize - 1, controlSize - 1); if (model.isPressed() && model.isArmed()) { gfx.setColor(PgsLookAndFeel.getControlShadow()); gfx.fillOval(x + 1, y + 1, controlSize - 2, controlSize - 2); gfx.setColor(PgsLookAndFeel.getControlInfo()); } else { gfx.setColor(PgsLookAndFeel.getControlShadow()); gfx.drawOval(x, y, controlSize - 1, controlSize - 1); if(model.isEnabled()) { gfx.setColor(PgsLookAndFeel.getPrimaryControlDarkShadow()); } else { gfx.setColor( model.isEnabled() ? PgsLookAndFeel.getPrimaryControlDarkShadow() : PgsLookAndFeel.getControlShadow());
g.setColor(PgsLookAndFeel.getControlHighlight()); g.fillRect(x, y, controlSize, controlSize); if (model.isRollover()) { g.setColor(PgsLookAndFeel.getPrimaryControl()); g.drawRect(x + 1, y + 1, controlSize - 3, controlSize - 3); g.setColor(PgsLookAndFeel.getControlDarkShadow()); g.drawRect(x, y, controlSize - 1, controlSize - 1); if (model.isPressed() && model.isArmed()) { g.setColor(PgsLookAndFeel.getControlShadow()); g.fillRect(x + 1, y + 1, controlSize - 2, controlSize - 2); g.setColor(PgsLookAndFeel.getControlInfo()); } else { g.setColor(PgsLookAndFeel.getControlShadow()); g.drawRect(x, y, controlSize - 1, controlSize - 1); model.isEnabled() ? PgsLookAndFeel.getPrimaryControlDarkShadow() : PgsLookAndFeel.getControlShadow()); drawCheck(c, g, x, y);
PlafOptions.useShadowBorder(getPropertyBoolValue(props, "pgs.shadowBorder", "false")); PlafOptions.useBoldFonts(getPropertyBoolValue(props, "swing.boldMetal", "false")); PlafOptions.useBoldMenuFonts(getPropertyBoolValue(props, "pgs.boldMenuFonts", "false")); PlafOptions.useExtraMargin(getPropertyBoolValue(props, "pgs.extraMargin", "true")); PlafOptions.useDisabledIcon(getPropertyBoolValue(props, "pgs.useDisabledIcon", "true")); PlafOptions.useToolBarIcon(getPropertyBoolValue(props, "pgs.useToolBarIcon", "true")); PlafOptions.setAntialiasingEnabled(getPropertyBoolValue(props, "pgs.aaEnabled", "false")); PlafOptions.setClearBorderEnabled(getPropertyBoolValue(props, "pgs.clearBorderEnabled", "false")); PlafOptions.setFixHtmlDisplayEnabled(getPropertyBoolValue(props, "pgs.fixHtmlDisplayEnabled", "true")); PlafOptions.setWheelTabbedPaneEnabled(getPropertyBoolValue(props, "pgs.wheelTabEnabled", "true")); PlafOptions.setTabbedPaneRightClickSelectionEnabled(getPropertyBoolValue(props, "pgs.tabbedPaneRightClickSelectionEnabled", "false")); PlafOptions.setTabReorderingEnabled(getPropertyBoolValue(props, "pgs.tabReorderingEnabled", "false")); PlafOptions.setPaintRolloverButtonBorder(getPropertyBoolValue(props, "pgs.paintRolloverButtonBorder", "true")); PlafOptions.setOfficeScrollBarEnabled(getPropertyBoolValue(props, "pgs.officeScrollBarEnabled", "false")); PlafOptions.setVistaStyle(getPropertyBoolValue(props, "pgs.vistaStyle", "false")); PlafOptions.setStyle(PlafOptions.MENUBAR, getPropertyStyleValue(props, "pgs.style.menuBar", "flat")); PlafOptions.setStyle(PlafOptions.MENU_ITEM, getPropertyStyleValue(props, "pgs.style.menuitem", "flat")); PlafOptions.setStyle( PlafOptions.MENUBARMENU, getPropertyStyleValue(props, "pgs.style.menuBarMenu", "flat")); PlafOptions .setStyle(PlafOptions.TOOLBAR, getPropertyStyleValue(props, "pgs.style.toolBar", "gradient")); PlafOptions.setStyle( PlafOptions.TOOLBARBUTTON, getPropertyStyleValue(props, "pgs.style.toolBarButton", "gradient")); PlafOptions.setStyle(PlafOptions.BUTTON, getPropertyStyleValue(props, "pgs.style.button", "gradient")); setCurrentTheme(theme); } else { logger.warning("Could not create theme from pgs.properties");
? PgsLookAndFeel.getPrimaryControlDarkShadow() : PgsLookAndFeel.getControlDisabled(); int width = getWidth(); int height = getHeight(); s = gfx.getStroke(); gfx.setStroke(new BasicStroke(2.4f, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER)); g.setColor(PgsLookAndFeel.getGlow()); if (getDirection() == NORTH) { g.drawRect(2, 1, width - 3, height - 3); g.setColor(isEnabled ? shadowColor : PgsLookAndFeel.getControlShadow());
MetalTheme theme = getCurrentTheme(); "ScrollPane.border", BorderFactory.createLineBorder(PgsLookAndFeel.getControlDarkShadow(), 1), "TabbedPane.background", PgsLookAndFeel.getControlShadow(), "SplitPane.border", null, "SplitPaneDivider.border", null, "OptionPane.errorIcon", makeIcon(getClass(), "icons/Error.png"), "OptionPane.informationIcon", makeIcon(getClass(), "icons/Inform.png"), "OptionPane.warningIcon", makeIcon(getClass(), "icons/Warn.png"), "OptionPane.questionIcon", makeIcon(getClass(), "icons/Question.png"), "FileView.computerIcon", makeIcon(getClass(), "icons/Computer.png"), "FileView.directoryIcon", makeIcon(getClass(), "icons/TreeClosed.png"), "FileView.fileIcon", makeIcon(getClass(), "icons/File.png"), "FileView.floppyDriveIcon", makeIcon(getClass(), "icons/FloppyDrive.png"), "FileView.hardDriveIcon", makeIcon(getClass(), "icons/HardDrive.png"), "FileChooser.homeFolderIcon", makeIcon(getClass(), "icons/HomeFolder.png"), "FileChooser.newFolderIcon", makeIcon(getClass(), "icons/NewFolder.png"), "FileChooser.upFolderIcon", makeIcon(getClass(), "icons/UpFolder.png"), "Tree.closedIcon", makeIcon(getClass(), "icons/TreeClosed.png"), "Tree.openIcon", makeIcon(getClass(), "icons/TreeOpen.png"), "Tree.leafIcon", makeIcon(getClass(), "icons/TreeLeaf.png") }; table.putDefaults(uiDefaults);
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (c.isEnabled()) { //PgsUtils.drawButtonBorder(g, x, y, w, h); boolean isEditable = (c instanceof JTextComponent && ((JTextComponent)c).isEditable()) || (c instanceof JComboBox && ((JComboBox)c).isEditable()); boolean hasFocus = c.hasFocus(); if(c instanceof JComboBox) { JComboBox comboBox = ((JComboBox) c); hasFocus = comboBox.isEditable() && comboBox.getEditor().getEditorComponent().hasFocus(); } PgsUtils.drawButtonBorder(g, x, y, w - 1, h - 1, 2, 2, hasFocus && isEditable ? PgsLookAndFeel.getPrimaryControlDarkShadow() : PgsLookAndFeel.getControlDarkShadow()); } else { PgsUtils.drawDisabledBorder(g, x, y, w - 1, h - 1, 2, 2); } }
public static void drawButtonBorder(Graphics g, int x, int y, int w, int h) { clearButtonBorder(g, x, y, w, h); drawButtonBorder(g, x, y, w - 1, h - 1, PgsLookAndFeel.getControlDarkShadow()); }
public static void drawRolloverButtonBorder(Graphics g, int x, int y, int w, int h) { if (UIManager.getBoolean("Button.rolloverVistaStyle")) { drawButtonBorder(g, x, y, w - 1, h - 1, PgsLookAndFeel.getGlow()); } else { drawButtonBorder(g, x + 1, y + 1, w - 3, h - 3, rolloverBorderStroke, PgsLookAndFeel.getGlow()); PgsUtils.drawButtonBorder(g, x, y, w, h); } }
public static void drawDisabledBorder(Graphics g, int x, int y, int w, int h, int c1, int c2) { clearButtonBorder(g, x, y, w, h); g.setColor(PgsLookAndFeel.getControlShadow()); if (PlafOptions.isClearBorderEnabled()) { g.drawRect(x, y, w, h); } else { drawRoundRect(g, x, y, w, h, c1, c2); } }
public void initialize() { super.initialize(); MetalLookAndFeel.setCurrentTheme(getCurrentTheme()); }
g.setColor(PgsLookAndFeel.getControlHighlight()); g.fillRect(x, y, controlSize, controlSize); ColorUtils.getTranslucentColor(PgsLookAndFeel.getControlShadow(), 0), ColorUtils.getTranslucentColor(PgsLookAndFeel.getControlShadow(), 50)); g.setColor(PgsLookAndFeel.getGlow()); g.drawRect(x + 1, y + 1, controlSize - 3, controlSize - 3); g.setColor(PgsLookAndFeel.getControlDarkShadow()); g.drawRect(x, y, controlSize - 1, controlSize - 1); if (model.isPressed() && model.isArmed()) { g.setColor(PgsLookAndFeel.getControlShadow()); g.fillRect(x + 1, y + 1, controlSize - 2, controlSize - 2); g.setColor(PgsLookAndFeel.getControlInfo()); } else { g.setColor(PgsLookAndFeel.getControlShadow()); g.drawRect(x, y, controlSize - 1, controlSize - 1); model.isEnabled() ? PgsLookAndFeel.getPrimaryControlDarkShadow() : PgsLookAndFeel.getControlShadow()); drawCheck(c, g, x, y);
g.setColor(PgsLookAndFeel.getControlDarkShadow()); g.drawLine(x + w - 1, y, x + w - 1, y + h); return; gfx.setColor(PgsLookAndFeel.getControlDarkShadow()); if (isSubTab()) { switch (tabPlacement) {
RenderingHints oldHints = gfx.getRenderingHints(); gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gfx.setColor(PgsLookAndFeel.getGlow()); Stroke oldStroke = gfx.getStroke(); gfx.setStroke(PgsUtils.rolloverBorderStroke);
@Override protected void configure() { VistaTheme vistaTheme = new VistaTheme() { public ColorUIResource getMenuBackground() { return new ColorUIResource(new Color(255, 255, 255)); } public ColorUIResource getSecondary3() { return new ColorUIResource(new Color(224, 231, 242)); } }; PgsLookAndFeel.setCurrentTheme(vistaTheme); }
public static void drawHorizontalBumps(Graphics g, int x, int y, int width) { int loops = width / 6; for (int i = 0; i < loops; i++) { g.setColor(PgsLookAndFeel.getControlShadow()); g.fillRect(x + (i * 6), y, 2, 2); g.fillRect(3 + x + (i * 6), y + 3, 2, 2); g.setColor(ColorUtils.getTranslucentColor(PgsLookAndFeel.getControl(), 180)); g.fillRect(1 + x + (i * 6), y + 1, 2, 2); g.fillRect(4 + x + (i * 6), y + 4, 2, 2); } }
g.setColor(PgsLookAndFeel.getControlDarkShadow()); PgsUtils.drawRoundRect(g, x, y, w - 1, h - 1); g.fillRect(selRect.x + 1, selRect.y + selRect.height - 2, selRect.width - 2, 1); if (selectedIndex == 0) { g.setColor(PgsLookAndFeel.getControlDarkShadow()); g.drawLine(x, selRect.y + selRect.height - 2, x, selRect.y + selRect.height + 2); g.fillRect(selRect.x + 1, selRect.y + 1, selRect.width - 1, 1); if (selectedIndex == 0) { g.setColor(PgsLookAndFeel.getControlDarkShadow()); g.drawLine(x, selRect.y - 2, x, selRect.y + 2); g.fillRect(selRect.x + selRect.width - 2, selRect.y + 1, 1, selRect.height - 1); if (selectedIndex == 0) { g.setColor(PgsLookAndFeel.getControlDarkShadow()); g.drawLine(selRect.x + selRect.width - 2, selRect.y, selRect.x + selRect.width + 2, selRect.y); g.fillRect(selRect.x + 1, selRect.y + 1, 1, selRect.height - 1); if (selectedIndex == 0) { g.setColor(PgsLookAndFeel.getControlDarkShadow()); g.drawLine(selRect.x - 2, selRect.y, selRect.x + 2, selRect.y);