protected void paintBackground(Graphics g) { int draggedColumn = -1; if ((header != null) && (header.getTable() != null) && header.getDraggedColumn() != null) { draggedColumn = header.getColumnModel().getColumnIndex(header.getDraggedColumn().getIdentifier()); } int w = getWidth(); int h = getHeight(); if ((table != null) && table.isEnabled() && (col == rolloverCol || col == draggedColumn)) { JTattooUtilities.fillHorGradient( g, AbstractLookAndFeel.getTheme().getRolloverColors(), 0, 0, w, h); if (drawRolloverBar()) { g.setColor(AbstractLookAndFeel.getFocusColor()); g.drawLine(0, 0, w - 1, 0); g.drawLine(0, 1, w - 1, 1); g.drawLine(0, 2, w - 1, 2); } } else if (drawAllwaysActive() || JTattooUtilities.isFrameActive(header)) { if (header.getBackground() instanceof ColorUIResource) { JTattooUtilities.fillHorGradient( g, AbstractLookAndFeel.getTheme().getColHeaderColors(), 0, 0, w, h); } else { g.setColor(header.getBackground()); g.fillRect(0, 0, w, h); } } else { if (header.getBackground() instanceof ColorUIResource) { JTattooUtilities.fillHorGradient( g, AbstractLookAndFeel.getTheme().getInActiveColors(), 0, 0, w, h); } else { g.setColor(header.getBackground()); g.fillRect(0, 0, w, h); } } }
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { if (JTattooUtilities.isFrameActive((JComponent) c)) { g.setColor(AbstractLookAndFeel.getWindowBorderColor()); } else { g.setColor(AbstractLookAndFeel.getWindowInactiveBorderColor()); } g.drawRect(x, y, w - 1, h - 1); }
public void paintPalette(Graphics g) { if (JTattooUtilities.isFrameActive(this)) { g.setColor(AbstractLookAndFeel.getWindowTitleBackgroundColor()); } else { g.setColor(AbstractLookAndFeel.getWindowInactiveTitleBackgroundColor()); } g.fillRect(0, 0, getWidth(), getHeight()); }
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { AbstractButton button = (AbstractButton) c; Graphics2D g2D = (Graphics2D) g; Color frameColor = AbstractLookAndFeel.getTheme().getFrameColor(); if (!JTattooUtilities.isFrameActive(button)) { frameColor = ColorHelper.brighter(frameColor, 40); } if (AbstractLookAndFeel.getTheme().doDrawSquareButtons()) { g2D.setColor(Color.white); g2D.drawRect(x, y, w - 1, h - 1); if (button.getRootPane() != null && button.equals(button.getRootPane().getDefaultButton()) && !button.hasFocus()) { g2D.setColor(ColorHelper.darker(frameColor, 20)); g2D.drawRect(x, y, w - 1, h - 2); if (!button.getModel().isRollover()) { g2D.setColor(defaultColorHi); g2D.drawRect(x + 1, y + 1, w - 3, h - 4); g2D.setColor(defaultColorLo); g2D.drawRect(x + 2, y + 2, w - 5, h - 6); } } else { g2D.setColor(frameColor); g2D.drawRect(x, y, w - 2, h - 2); } } else { Object savedRederingHint = g2D.getRenderingHint(RenderingHints.KEY_ANTIALIASING); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); if (button.getRootPane() != null && button.equals(button.getRootPane().getDefaultButton())) { if (!button.getModel().isRollover()) { g2D.setColor(defaultColorHi); g2D.drawRoundRect(x + 1, y + 1, w - 4, h - 2, 6, 6); g2D.setColor(defaultColorLo); g2D.drawRoundRect(x + 2, y + 2, w - 6, h - 6, 6, 6); } } g2D.setColor(Color.white); g2D.drawRoundRect(x, y, w - 1, h - 1, 6, 6); g2D.setColor(frameColor); g2D.drawRoundRect(x, y, w - 2, h - 2, 6, 6); g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, savedRederingHint); } }
protected void paintBackground(Graphics g, Rectangle cellRect, int col) { Component component = getHeaderRenderer(col); int x = cellRect.x; int y = cellRect.y; int w = cellRect.width; int h = cellRect.height; if (header.getBackground() instanceof ColorUIResource) { if ((col == rolloverCol) && (component != null) && component.isEnabled()) { JTattooUtilities.fillHorGradient( g, AbstractLookAndFeel.getTheme().getRolloverColors(), x, y, w, h); } else if (drawAllwaysActive() || JTattooUtilities.isFrameActive(header)) { JTattooUtilities.fillHorGradient( g, AbstractLookAndFeel.getTheme().getColHeaderColors(), x, y, w, h); } else { JTattooUtilities.fillHorGradient( g, AbstractLookAndFeel.getTheme().getInActiveColors(), x, y, w, h); } } else { g.setColor(header.getBackground()); g.fillRect(x, y, w, h); } }