Mercurial > hg > release > thermostat-1.0
changeset 1303:6b093611c830
Some color tweeks
review-thread: http://icedtea.classpath.org/pipermail/thermostat/2013-November/008651.html
reviewed-by: omajid
author | Mario Torre <neugens.limasoftware@gmail.com> |
---|---|
date | Thu, 07 Nov 2013 09:42:25 +0100 |
parents | 8d65d5454f78 |
children | 271febce6e59 |
files | client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/accordion/Accordion.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/ExpanderComponent.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/ThermostatSidePanel.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/TopSidePane.java client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/vmlist/ReferenceComponentPainter.java |
diffstat | 5 files changed, 10 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/accordion/Accordion.java Wed Nov 06 07:55:20 2013 -0500 +++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/accordion/Accordion.java Thu Nov 07 09:42:25 2013 +0100 @@ -37,6 +37,7 @@ package com.redhat.thermostat.client.swing.internal.accordion; import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.event.MouseAdapter; @@ -50,6 +51,7 @@ import com.redhat.thermostat.client.swing.components.ThermostatScrollPane; import com.redhat.thermostat.client.swing.components.VerticalLayout; +import com.redhat.thermostat.client.ui.Palette; /** * An Accordion widget. H and C types represent Header and Component and are @@ -65,6 +67,8 @@ @SuppressWarnings("serial") public class Accordion<H, C> extends JPanel { + public static final Color BASE_COLOR = Palette.WHITE.getColor(); + public static final int ICON_SIZE = 24; static final int MIN_HEIGHT = ICON_SIZE; @@ -84,12 +88,15 @@ public Accordion(AccordionComponentFactory<H, C> componentFactory) { + setBackground(BASE_COLOR); + this.componentFactory = componentFactory; componentController = new AccordionComponentController(); setLayout(new BorderLayout()); contentPane = new AccordionContentPane(); + contentPane.setBackground(BASE_COLOR); contentPane.setLayout(new VerticalLayout()); model = new AccordionModel<>();
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/ExpanderComponent.java Wed Nov 06 07:55:20 2013 -0500 +++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/ExpanderComponent.java Thu Nov 07 09:42:25 2013 +0100 @@ -37,12 +37,7 @@ package com.redhat.thermostat.client.swing.internal.sidepane; import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Component; import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Insets; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; @@ -51,54 +46,18 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; -import com.redhat.thermostat.client.swing.GraphicsUtils; -import com.redhat.thermostat.client.swing.components.DebugBorder; import com.redhat.thermostat.client.swing.components.FontAwesomeIcon; import com.redhat.thermostat.client.swing.components.Icon; -import com.redhat.thermostat.client.swing.internal.splitpane.ThermostatSplitPane; -import com.redhat.thermostat.client.ui.Palette; @SuppressWarnings("serial") public class ExpanderComponent extends JPanel { public static int ICON_WIDTH = 20; public static final String EXPANDED_PROPERTY = "ExpanderComponent_EXPANDED_PROPERTY"; - - private class ExpanderComponentBorder extends DebugBorder { - @Override - public void paintBorder(Component c, Graphics g, int x, int y, - int width, int height) - { - Graphics2D graphics = GraphicsUtils.getInstance().createAAGraphics(g); - Insets insets = getBorderInsets(c); - - int xStart = x + width - insets.right; - graphics.translate(xStart, y); - - graphics.setColor(Palette.LIGHT_GRAY.getColor()); - graphics.fillRect(0, y, width, height); - - ThermostatSplitPane.paint(graphics, insets.right, height, Palette.LIGHT_GRAY.getColor()); - graphics.dispose(); - } - - @Override - public Insets getBorderInsets(Component c, Insets insets) { - insets.top = 0; - insets.left = 0; - insets.right = 5; - insets.bottom = 1; - - return insets; - } - } public ExpanderComponent() { - setBackground(Color.BLACK); setLayout(new BorderLayout()); - - setBorder(new ExpanderComponentBorder()); final Icon mainIcon = new FontAwesomeIcon('\uf101', ICON_WIDTH, TopSidePane.FG_COLOR); final Icon hover = new FontAwesomeIcon('\uf101', ICON_WIDTH, ThermostatSidePanel.FG_TEXT_COLOR);
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/ThermostatSidePanel.java Wed Nov 06 07:55:20 2013 -0500 +++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/ThermostatSidePanel.java Thu Nov 07 09:42:25 2013 +0100 @@ -38,10 +38,6 @@ import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Rectangle; -import java.awt.image.BufferedImage; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; @@ -66,7 +62,6 @@ public ThermostatSidePanel() { setLayout(new BorderLayout()); - setBackground(Color.BLACK); top = new TopSidePane(); top.addPropertyChangeListener(TopSidePane.COLLAPSED_PROPERTY,
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/TopSidePane.java Wed Nov 06 07:55:20 2013 -0500 +++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/sidepane/TopSidePane.java Thu Nov 07 09:42:25 2013 +0100 @@ -65,7 +65,7 @@ private Color currentFGColor = ThermostatSidePanel.FG_COLOR; public TopSidePane() { - setBackground(Color.BLACK); + setBackground(Color.WHITE); setLayout(new BorderLayout()); final Icon mainIcon = new FontAwesomeIcon('\uf100', ICON_WIDTH, FG_COLOR);
--- a/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/vmlist/ReferenceComponentPainter.java Wed Nov 06 07:55:20 2013 -0500 +++ b/client/swing/src/main/java/com/redhat/thermostat/client/swing/internal/vmlist/ReferenceComponentPainter.java Thu Nov 07 09:42:25 2013 +0100 @@ -41,6 +41,7 @@ import java.awt.Rectangle; import com.redhat.thermostat.client.swing.GraphicsUtils; +import com.redhat.thermostat.client.swing.internal.accordion.Accordion; import com.redhat.thermostat.client.swing.internal.accordion.AccordionComponent; import com.redhat.thermostat.client.swing.internal.accordion.TitledPanePainter; @@ -65,7 +66,7 @@ if (component.isSelected()) { graphics.setColor(palette.getSelectedComponentBGColor()); } else { - graphics.setColor(component.getUiComponent().getBackground()); + graphics.setColor(Accordion.BASE_COLOR); } Rectangle bounds = graphics.getClipBounds();