List of usage examples for java.awt Color YELLOW
Color YELLOW
To view the source code for java.awt Color YELLOW.
Click Source Link
From source file:PieChartDemo1.java
/** * Creates a chart./*from w w w . java 2 s . c om*/ * * @param dataset the dataset. * * @return A chart. */ private static JFreeChart createChart(PieDataset dataset) { JFreeChart chart = ChartFactory.createPieChart("Smart Phones Manufactured / Q3 2011", // chart title dataset, // data false, // no legend true, // tooltips false // no URL generation ); // set a custom background for the chart chart.setBackgroundPaint( new GradientPaint(new Point(0, 0), new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY)); // customise the title position and font TextTitle t = chart.getTitle(); t.setHorizontalAlignment(HorizontalAlignment.LEFT); t.setPaint(new Color(240, 240, 240)); t.setFont(new Font("Arial", Font.BOLD, 26)); PiePlot plot = (PiePlot) chart.getPlot(); plot.setBackgroundPaint(null); plot.setInteriorGap(0.04); plot.setOutlineVisible(false); // use gradients and white borders for the section colours plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE)); plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED)); plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN)); plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW)); plot.setBaseSectionOutlinePaint(Color.WHITE); plot.setSectionOutlinesVisible(true); plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f)); // customise the section label appearance plot.setLabelFont(new Font("Courier New", Font.BOLD, 20)); plot.setLabelLinkPaint(Color.WHITE); plot.setLabelLinkStroke(new BasicStroke(2.0f)); plot.setLabelOutlineStroke(null); plot.setLabelPaint(Color.WHITE); plot.setLabelBackgroundPaint(null); // add a subtitle giving the data source TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523", new Font("Courier New", Font.PLAIN, 12)); source.setPaint(Color.WHITE); source.setPosition(RectangleEdge.BOTTOM); source.setHorizontalAlignment(HorizontalAlignment.RIGHT); chart.addSubtitle(source); return chart; }
From source file:org.matsim.counts.algorithms.graphs.CountsGEHCurveGraph.java
@Override public JFreeChart createChart(final int nbr) { String title = this.getChartTitle() + ", Iteration: " + this.iteration_; this.chart_ = ChartFactory.createBarChart(title, "Hour", "GEH", this.dataset, PlotOrientation.VERTICAL, false, // legend? false, // tooltips? false // URLs? );//from w w w .j a va2 s .c o m CategoryPlot plot = this.chart_.getCategoryPlot(); // plot.getRangeAxis().setRange(0.0, 10000.0); // do not set a fixed range for the single link graphs plot.getDomainAxis().setCategoryLabelPositions(CategoryLabelPositions.UP_45); // BarRenderer renderer=(BarRenderer) plot.getRenderer(); // BarRenderer renderer = new BarRenderer(); /* * Chooses the color adaptive based on the value to be shown by a bar. * Values <= 5.0 are green, values >= 10 are red. In between the color is interpolated. */ BarRenderer renderer = new BarRenderer() { @Override public Paint getItemPaint(final int row, final int column) { double value = dataset.getValue(row, column).doubleValue(); if (value <= 5.0) return Color.green; else if (value >= 10) return Color.red; else { if (value < 7.5) { int mixed = mix(Color.yellow.getRGB(), Color.green.getRGB(), (7.5 - value) / 2.5); return new Color(mixed); } else { int mixed = mix(Color.red.getRGB(), Color.yellow.getRGB(), (10.0 - value) / 2.5); return new Color(mixed); } } // if (value <= 5.0) return Color.green; // else if (value >= 10) return Color.red; // else { // int mixed = mix(Color.red.getRGB(), Color.green.getRGB(), (10.0 - value) / 5.0); // return new Color(mixed); // } } }; renderer.setSeriesOutlinePaint(0, Color.black); renderer.setSeriesPaint(0, Color.getHSBColor((float) 0.62, (float) 0.56, (float) 0.93)); renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator()); renderer.setItemMargin(0.0); // configure plot with light colors instead of the default 3D renderer.setShadowVisible(false); renderer.setBarPainter(new StandardBarPainter()); this.chart_.setBackgroundPaint(Color.getHSBColor((float) 0.0, (float) 0.0, (float) 0.93)); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.gray); plot.setRangeGridlinesVisible(true); plot.setRenderer(0, renderer); plot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); plot.mapDatasetToRangeAxis(1, 1); final CategoryAxis axis1 = plot.getDomainAxis(); axis1.setCategoryMargin(0.25); // leave a gap of 25% between categories return this.chart_; }
From source file:org.esa.smos.gui.gridpoint.GridPointBtDataFlagmatrixTopComponent.java
@Override protected JComponent createGridPointComponent() { dataset = new DefaultXYZDataset(); final NumberAxis xAxis = new NumberAxis("Record #"); xAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); xAxis.setAutoRangeIncludesZero(false); xAxis.setLowerMargin(0.0);//w w w. j a v a 2s . c om xAxis.setUpperMargin(0.0); final List<FlagDescriptor> flagDescriptorList = Dddb.getInstance() .getFlagDescriptors(DEFAULT_FLAG_DESCRIPTOR_IDENTIFIER).asList(); flagDescriptors = flagDescriptorList.toArray(new FlagDescriptor[flagDescriptorList.size()]); final String[] flagNames = createFlagNames(flagDescriptors); final NumberAxis yAxis = createRangeAxis(flagNames); final LookupPaintScale paintScale = new LookupPaintScale(0.0, 4.0, Color.WHITE); paintScale.add(0.0, Color.BLACK); paintScale.add(1.0, Color.RED); paintScale.add(2.0, Color.GREEN); paintScale.add(3.0, Color.BLUE); paintScale.add(4.0, Color.YELLOW); renderer = new XYBlockRenderer(); renderer.setPaintScale(paintScale); renderer.setBaseToolTipGenerator(new FlagToolTipGenerator(flagNames)); plot = new XYPlot(dataset, xAxis, yAxis, renderer); plot.setBackgroundPaint(Color.LIGHT_GRAY); plot.setDomainGridlinePaint(Color.WHITE); plot.setRangeGridlinePaint(Color.WHITE); plot.setForegroundAlpha(0.5f); plot.setAxisOffset(new RectangleInsets(5, 5, 5, 5)); plot.setNoDataMessage("No data"); chart = new JFreeChart(null, plot); chart.removeLegend(); chartPanel = new ChartPanel(chart); return chartPanel; }
From source file:ExposedInt.java
public void init() { Panel buttonPanel = new PanelWithInsets(0, 0, 0, 0); buttonPanel.setLayout(new GridLayout(3, 2, 5, 5)); buttonPanel.add(new GrayButton(ExposedIntStringTable.increment)); buttonPanel.add(new GrayButton(ExposedIntStringTable.decrement)); buttonPanel.add(minimumButton);//from ww w . j a v a2 s .c o m buttonPanel.add(maximumButton); buttonPanel.add(zeroButton); buttonPanel.add(new GrayButton(ExposedIntStringTable.negate)); zeroButton.disable(); binaryField = new Label("00000000000000000000000000000000"); hexField = new Label("00000000"); decimalField = new Label("0"); Font fieldFont = new Font("TimesRoman", Font.PLAIN, 12); binaryField.setFont(fieldFont); hexField.setFont(fieldFont); decimalField.setFont(fieldFont); Panel numberPanel = new Panel(); numberPanel.setBackground(Color.white); numberPanel.setLayout(new GridLayout(3, 1)); Panel binaryPanel = new Panel(); binaryPanel.setLayout(new BorderLayout()); binaryPanel.add("Center", binaryField); numberPanel.add(binaryPanel); Panel hexPanel = new Panel(); hexPanel.setLayout(new BorderLayout()); hexPanel.add("Center", hexField); numberPanel.add(hexPanel); numberPanel.add(decimalField); Panel labelPanel = new Panel(); labelPanel.setBackground(Color.white); labelPanel.setLayout(new GridLayout(3, 1)); Label label = new Label(ExposedIntStringTable.binary, Label.CENTER); Font labelFont = new Font("Helvetica", Font.ITALIC, 11); label.setFont(labelFont); labelPanel.add(label); label = new Label(ExposedIntStringTable.hex, Label.CENTER); label.setFont(labelFont); labelPanel.add(label); label = new Label(ExposedIntStringTable.decimal, Label.CENTER); label.setFont(labelFont); labelPanel.add(label); Panel dataPanel = new Panel(); dataPanel.setLayout(new BorderLayout()); dataPanel.add("West", labelPanel); dataPanel.add("Center", numberPanel); ColoredLabel title = new ColoredLabel(ExposedIntStringTable.title, Label.CENTER, Color.yellow); title.setFont(new Font("Helvetica", Font.BOLD, 12)); setBackground(Color.red); setLayout(new BorderLayout(5, 5)); add("North", title); add("West", buttonPanel); add("Center", dataPanel); }
From source file:org.encog.workbench.tabs.visualize.structure.GenomeStructureTab.java
public GenomeStructureTab(NEATGenome genome) { super(null);// w w w.j av a2 s . c om this.genome = genome; // Graph<V, E> where V is the type of the vertices // and E is the type of the edges Graph<DrawnNeuron, DrawnConnection> g = null; g = buildGraph(genome); if (g == null) { throw new WorkBenchError("Can't visualize genome"); } Transformer<DrawnNeuron, Point2D> staticTranformer = new Transformer<DrawnNeuron, Point2D>() { public Point2D transform(DrawnNeuron n) { int x = (int) (n.getX() * 600); int y = (int) (n.getY() * 300); Point2D result = new Point(x + 32, y); return result; } }; Transformer<DrawnNeuron, Paint> vertexPaint = new Transformer<DrawnNeuron, Paint>() { public Paint transform(DrawnNeuron neuron) { switch (neuron.getType()) { case Bias: return Color.yellow; case Input: return Color.white; case Output: return Color.green; case Context: return Color.cyan; case Linear: return Color.blue; case Sigmoid: return Color.magenta; case Gaussian: return Color.cyan; case SIN: return Color.gray; default: return Color.red; } } }; Transformer<DrawnConnection, Paint> edgePaint = new Transformer<DrawnConnection, Paint>() { public Paint transform(DrawnConnection connection) { if (connection.isContext()) { return Color.lightGray; } else { return Color.black; } } }; // The Layout<V, E> is parameterized by the vertex and edge types StaticLayout<DrawnNeuron, DrawnConnection> layout = new StaticLayout<DrawnNeuron, DrawnConnection>(g, staticTranformer); layout.setSize(new Dimension(5000, 5000)); // sets the initial size of // the space // The BasicVisualizationServer<V,E> is parameterized by the edge types // BasicVisualizationServer<DrawnNeuron, DrawnConnection> vv = new // BasicVisualizationServer<DrawnNeuron, DrawnConnection>( // layout); // Dimension d = new Dimension(600,600); vv = new VisualizationViewer<DrawnNeuron, DrawnConnection>(layout); // vv.setPreferredSize(d); //Sets the viewing area size vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR); vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint); vv.getRenderContext().setEdgeDrawPaintTransformer(edgePaint); vv.getRenderContext().setArrowDrawPaintTransformer(edgePaint); vv.getRenderContext().setArrowFillPaintTransformer(edgePaint); vv.setVertexToolTipTransformer(new ToStringLabeller()); vv.setVertexToolTipTransformer(new Transformer<DrawnNeuron, String>() { public String transform(DrawnNeuron edge) { return edge.getToolTip(); } }); vv.setEdgeToolTipTransformer(new Transformer<DrawnConnection, String>() { public String transform(DrawnConnection edge) { return edge.getToolTip(); } }); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); this.setLayout(new BorderLayout()); add(panel, BorderLayout.CENTER); final AbstractModalGraphMouse graphMouse = new DefaultModalGraphMouse(); vv.setGraphMouse(graphMouse); vv.addKeyListener(graphMouse.getModeKeyListener()); final ScalingControl scaler = new CrossoverScalingControl(); JButton plus = new JButton("+"); plus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1.1f, vv.getCenter()); } }); JButton minus = new JButton("-"); minus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1 / 1.1f, vv.getCenter()); } }); JButton reset = new JButton("reset"); reset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT).setToIdentity(); vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW).setToIdentity(); } }); JPanel controls = new JPanel(); controls.setLayout(new FlowLayout(FlowLayout.LEFT)); controls.add(plus); controls.add(minus); controls.add(reset); Border border = BorderFactory.createEtchedBorder(); controls.setBorder(border); add(controls, BorderLayout.NORTH); add(new LegendPanel(true), BorderLayout.SOUTH); }
From source file:com.seleniumtests.it.driver.TestBrowserSnapshot.java
/** * Read the capture file to detect dimension * It assumes that picture background is white and counts the number of white pixels in width and height (first column and first row) * @return/* ww w. ja v a 2s .c om*/ * @throws IOException */ private Dimension getViewPortDimension(File picture) throws IOException { BufferedImage image = ImageIO.read(picture); int width = 0; int height = 0; for (width = 0; width < image.getWidth(); width++) { Color color = new Color(image.getRGB(width, 0)); if (!(color.equals(Color.WHITE) || color.equals(Color.YELLOW) || color.equals(Color.ORANGE) || color.equals(Color.GREEN) || color.equals(Color.RED))) { break; } } for (height = 0; height < image.getHeight(); height++) { Color color = new Color(image.getRGB(5, height)); if (!(color.equals(Color.WHITE) || color.equals(Color.YELLOW) || color.equals(Color.ORANGE) || color.equals(Color.GREEN) || color.equals(Color.RED))) { break; } } return new Dimension(width, height); }
From source file:icaro.aplicaciones.recursos.recursoEstadistica.jFreeChart.demo.PieChartDemo1.java
/** * Creates a chart./*from ww w . j a v a 2 s . c o m*/ * * @param dataset the dataset. * * @return A chart. */ private static JFreeChart createChart(PieDataset dataset) { JFreeChart chart = ChartFactory.createPieChart("Smart Phones Manufactured / Q3 2011", // chart title dataset, // data false, // no legend true, // tooltips false // no URL generation ); // set a custom background for the chart chart.setBackgroundPaint( new GradientPaint(new Point(0, 0), new Color(20, 20, 20), new Point(400, 200), Color.DARK_GRAY)); // customise the title position and font TextTitle t = chart.getTitle(); t.setHorizontalAlignment(HorizontalAlignment.LEFT); t.setPaint(new Color(240, 240, 240)); t.setFont(new Font("Arial", Font.BOLD, 26)); PiePlot plot = (PiePlot) chart.getPlot(); plot.setBackgroundPaint(null); plot.setInteriorGap(0.04); // plot.setOutlineVisible(false); // use gradients and white borders for the section colours plot.setSectionPaint("Others", createGradientPaint(new Color(200, 200, 255), Color.BLUE)); plot.setSectionPaint("Samsung", createGradientPaint(new Color(255, 200, 200), Color.RED)); plot.setSectionPaint("Apple", createGradientPaint(new Color(200, 255, 200), Color.GREEN)); plot.setSectionPaint("Nokia", createGradientPaint(new Color(200, 255, 200), Color.YELLOW)); plot.setBaseSectionOutlinePaint(Color.WHITE); plot.setSectionOutlinesVisible(true); plot.setBaseSectionOutlineStroke(new BasicStroke(2.0f)); // customise the section label appearance plot.setLabelFont(new Font("Courier New", Font.BOLD, 20)); plot.setLabelLinkPaint(Color.WHITE); plot.setLabelLinkStroke(new BasicStroke(2.0f)); plot.setLabelOutlineStroke(null); plot.setLabelPaint(Color.WHITE); plot.setLabelBackgroundPaint(null); // add a subtitle giving the data source TextTitle source = new TextTitle("Source: http://www.bbc.co.uk/news/business-15489523", new Font("Courier New", Font.PLAIN, 12)); source.setPaint(Color.WHITE); source.setPosition(RectangleEdge.BOTTOM); source.setHorizontalAlignment(HorizontalAlignment.RIGHT); chart.addSubtitle(source); return chart; }
From source file:org.encog.workbench.tabs.visualize.structure.StructureTab.java
public StructureTab(MLMethod method) { super(null);//from w w w . j ava 2s. co m // Graph<V, E> where V is the type of the vertices // and E is the type of the edges Graph<DrawnNeuron, DrawnConnection> g = null; if (method instanceof BasicNetwork) { BasicNetwork network = (BasicNetwork) method; g = buildGraph(network.getStructure().getFlat()); } else if (method instanceof NEATNetwork) { NEATNetwork neat = (NEATNetwork) method; g = buildGraph(neat); } if (g == null) { throw new WorkBenchError("Can't visualize network: " + method.getClass().getSimpleName()); } Transformer<DrawnNeuron, Point2D> staticTranformer = new Transformer<DrawnNeuron, Point2D>() { public Point2D transform(DrawnNeuron n) { int x = (int) (n.getX() * 600); int y = (int) (n.getY() * 300); Point2D result = new Point(x + 32, y); return result; } }; Transformer<DrawnNeuron, Paint> vertexPaint = new Transformer<DrawnNeuron, Paint>() { public Paint transform(DrawnNeuron neuron) { switch (neuron.getType()) { case Bias: return Color.yellow; case Input: return Color.white; case Output: return Color.green; case Context: return Color.cyan; default: return Color.red; } } }; Transformer<DrawnConnection, Paint> edgePaint = new Transformer<DrawnConnection, Paint>() { public Paint transform(DrawnConnection connection) { if (connection.isContext()) { return Color.lightGray; } else { return Color.black; } } }; // The Layout<V, E> is parameterized by the vertex and edge types StaticLayout<DrawnNeuron, DrawnConnection> layout = new StaticLayout<DrawnNeuron, DrawnConnection>(g, staticTranformer); layout.setSize(new Dimension(5000, 5000)); // sets the initial size of the space // The BasicVisualizationServer<V,E> is parameterized by the edge types //BasicVisualizationServer<DrawnNeuron, DrawnConnection> vv = new BasicVisualizationServer<DrawnNeuron, DrawnConnection>( // layout); //Dimension d = new Dimension(600,600); vv = new VisualizationViewer<DrawnNeuron, DrawnConnection>(layout); //vv.setPreferredSize(d); //Sets the viewing area size vv.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR); vv.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); vv.getRenderContext().setVertexFillPaintTransformer(vertexPaint); vv.getRenderContext().setEdgeDrawPaintTransformer(edgePaint); vv.getRenderContext().setArrowDrawPaintTransformer(edgePaint); vv.getRenderContext().setArrowFillPaintTransformer(edgePaint); vv.setVertexToolTipTransformer(new ToStringLabeller()); vv.setVertexToolTipTransformer(new Transformer<DrawnNeuron, String>() { public String transform(DrawnNeuron edge) { return edge.getToolTip(); } }); vv.setEdgeToolTipTransformer(new Transformer<DrawnConnection, String>() { public String transform(DrawnConnection edge) { return edge.getToolTip(); } }); final GraphZoomScrollPane panel = new GraphZoomScrollPane(vv); this.setLayout(new BorderLayout()); add(panel, BorderLayout.CENTER); final AbstractModalGraphMouse graphMouse = new DefaultModalGraphMouse(); vv.setGraphMouse(graphMouse); vv.addKeyListener(graphMouse.getModeKeyListener()); final ScalingControl scaler = new CrossoverScalingControl(); JButton plus = new JButton("+"); plus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1.1f, vv.getCenter()); } }); JButton minus = new JButton("-"); minus.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { scaler.scale(vv, 1 / 1.1f, vv.getCenter()); } }); JButton reset = new JButton("reset"); reset.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.LAYOUT).setToIdentity(); vv.getRenderContext().getMultiLayerTransformer().getTransformer(Layer.VIEW).setToIdentity(); } }); JPanel controls = new JPanel(); controls.setLayout(new FlowLayout(FlowLayout.LEFT)); controls.add(plus); controls.add(minus); controls.add(reset); Border border = BorderFactory.createEtchedBorder(); controls.setBorder(border); add(controls, BorderLayout.NORTH); }
From source file:org.nbheaven.sqe.codedefects.history.controlcenter.panels.SQEHistoryPanel.java
/** Creates new form SQEHistoryPanel */ public SQEHistoryPanel() { historyChart = org.jfree.chart.ChartFactory.createStackedXYAreaChart(null, "Snapshot", "CodeDefects", perProjectDataSet, PlotOrientation.VERTICAL, false, true, false); historyChart.setBackgroundPaint(Color.WHITE); historyChart.getXYPlot().setRangeGridlinePaint(Color.BLACK); historyChart.getXYPlot().setDomainGridlinePaint(Color.BLACK); historyChart.getXYPlot().setBackgroundPaint(Color.WHITE); XYPlot plot = historyChart.getXYPlot(); plot.setForegroundAlpha(0.7f);/*from w ww . j a v a 2 s . c o m*/ // plot.getRenderer(); NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); LogarithmicAxis rangeAxis = new LogarithmicAxis("CodeDefects"); rangeAxis.setStrictValuesFlag(false); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); plot.setRangeAxis(rangeAxis); StackedXYAreaRenderer2 categoryItemRenderer = new StackedXYAreaRenderer2(); //3D(); categoryItemRenderer.setSeriesPaint(0, Color.RED); categoryItemRenderer.setSeriesPaint(1, Color.ORANGE); categoryItemRenderer.setSeriesPaint(2, Color.YELLOW); plot.setRenderer(categoryItemRenderer); ChartPanel historyChartPanel = new ChartPanel(historyChart); historyChartPanel.setBorder(null); historyChartPanel.setPreferredSize(new Dimension(150, 200)); historyChartPanel.setBackground(Color.WHITE); initComponents(); historyView.setLayout(new BorderLayout()); historyView.add(historyChartPanel, BorderLayout.CENTER); JPanel selectorPanel = new JPanel(); selectorPanel.setOpaque(false); GroupLayout layout = new GroupLayout(selectorPanel); selectorPanel.setLayout(layout); // Turn on automatically adding gaps between components layout.setAutocreateGaps(true); // Turn on automatically creating gaps between components that touch // the edge of the container and the container. layout.setAutocreateContainerGaps(true); ParallelGroup horizontalParallelGroup = layout.createParallelGroup(GroupLayout.LEADING); SequentialGroup verticalSequentialGroup = layout.createSequentialGroup(); layout.setHorizontalGroup(layout.createSequentialGroup().add(horizontalParallelGroup)); layout.setVerticalGroup(verticalSequentialGroup); clearHistoryButton = new JButton(); clearHistoryButton.setEnabled(false); clearHistoryButton.setIcon(ImageUtilities .image2Icon(ImageUtilities.loadImage("org/nbheaven/sqe/codedefects/history/resources/trash.png"))); clearHistoryButton.setOpaque(false); clearHistoryButton.setFocusPainted(false); clearHistoryButton.setToolTipText( NbBundle.getBundle("org/nbheaven/sqe/codedefects/history/controlcenter/panels/Bundle") .getString("HINT_clear_button")); horizontalParallelGroup.add(clearHistoryButton); verticalSequentialGroup.add(clearHistoryButton); clearHistoryButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (null != activeHistory) { activeHistory.clear(); } } }); Component createVerticalStrut = Box.createVerticalStrut(10); horizontalParallelGroup.add(createVerticalStrut); verticalSequentialGroup.add(createVerticalStrut); for (final QualityProvider provider : SQEUtilities.getProviders()) { final JToggleButton providerButton = new JToggleButton(); providerButton.setIcon(provider.getIcon()); providerButton.setOpaque(false); providerButton.setFocusPainted(false); horizontalParallelGroup.add(providerButton); verticalSequentialGroup.add(providerButton); ActionListener listener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (providerButton.isSelected()) { addSelectedProvider(provider); } else { removeSelectedProvider(provider); } updateView(); } }; providerButton.addActionListener(listener); addSelectedProvider(provider); providerButton.setSelected(true); } historyView.add(selectorPanel, BorderLayout.EAST); }
From source file:com.okmich.hackerday.client.tool.dashboard.ReportItemPanel.java
public void onMouseEnter() { setBorder(BorderFactory.createLineBorder(Color.YELLOW)); }