/** * Sets the Paint object being displayed in the panel. * * @param paint the paint. */ public void setPaint(final Paint paint) { this.paint = paint; repaint(); }
/** * Returns the current background paint. * * @return The current background paint. */ public Paint getBackgroundPaint() { return this.backgroundPaintSample.getPaint(); }
/** * Fills the component with the current Paint. * * @param g the graphics device. */ public void paintComponent(final Graphics g) { final Graphics2D g2 = (Graphics2D) g; final Dimension size = getSize(); final Insets insets = getInsets(); final double xx = insets.left; final double yy = insets.top; final double ww = size.getWidth() - insets.left - insets.right - 1; final double hh = size.getHeight() - insets.top - insets.bottom - 1; final Rectangle2D area = new Rectangle2D.Double(xx, yy, ww, hh); g2.setPaint(this.paint); g2.fill(area); g2.setPaint(Color.black); g2.draw(area); }
/** * Allow the user the opportunity to select a Paint object. For now, we * just use the standard color chooser - all colors are Paint objects, but * not all Paint objects are colors (later we can implement a more general * Paint chooser). */ public void attemptPaintSelection() { Paint p = this.titlePaint.getPaint(); Color defaultColor = (p instanceof Color ? (Color) p : Color.blue); Color c = JColorChooser.showDialog( this, localizationResources.getString("Title_Color"), defaultColor ); if (c != null) { this.titlePaint.setPaint(c); } }
/** * Allow the user to change the background paint. */ private void attemptBackgroundPaintSelection() { Color c; c = JColorChooser.showDialog(this, localizationResources.getString( "Background_Color"), Color.blue); if (c != null) { this.backgroundPaintSample.setPaint(c); } }
this.maximumValue = axis.getUpperBound(); this.gridPaintSample = new PaintSample(Color.blue); this.gridStrokeSample = new StrokeSample(new BasicStroke(1.0f));
/** * Fills the component with the current Paint. * * @param g the graphics device. */ public void paintComponent(final Graphics g) { final Graphics2D g2 = (Graphics2D) g; final Dimension size = getSize(); final Insets insets = getInsets(); final double xx = insets.left; final double yy = insets.top; final double ww = size.getWidth() - insets.left - insets.right - 1; final double hh = size.getHeight() - insets.top - insets.bottom - 1; final Rectangle2D area = new Rectangle2D.Double(xx, yy, ww, hh); g2.setPaint(this.paint); g2.fill(area); g2.setPaint(Color.black); g2.draw(area); }
/** * Handle a grid paint selection. */ private void attemptGridPaintSelection() { Color c; c = JColorChooser.showDialog(this, localizationResources.getString( "Grid_Color"), Color.blue); if (c != null) { this.gridPaintSample.setPaint(c); } }
interior.add(new JLabel(localizationResources.getString( "Background_paint"))); this.background = new PaintSample(chart.getBackgroundPaint()); interior.add(this.background); JButton button = new JButton(localizationResources.getString(
/** * Fills the component with the current Paint. * * @param g the graphics device. */ public void paintComponent(final Graphics g) { final Graphics2D g2 = (Graphics2D) g; final Dimension size = getSize(); final Insets insets = getInsets(); final double xx = insets.left; final double yy = insets.top; final double ww = size.getWidth() - insets.left - insets.right - 1; final double hh = size.getHeight() - insets.top - insets.bottom - 1; final Rectangle2D area = new Rectangle2D.Double(xx, yy, ww, hh); g2.setPaint(this.paint); g2.fill(area); g2.setPaint(Color.black); g2.draw(area); }
/** * Sets the Paint object being displayed in the panel. * * @param paint the paint. */ public void setPaint(final Paint paint) { this.paint = paint; repaint(); }
/** * Returns the paint selected in the panel. * * @return The paint selected in the panel. */ public Paint getTitlePaint() { return this.titlePaint.getPaint(); }
/** * Allow the user to change the outline paint. We use JColorChooser, so * the user can only choose colors (a subset of all possible paints). */ private void attemptOutlinePaintSelection() { Color c; c = JColorChooser.showDialog(this, localizationResources.getString( "Outline_Color"), Color.blue); if (c != null) { this.outlinePaintSample.setPaint(c); } }
this.titleFont = t.getFont(); this.titleField = new JTextField(t.getText()); this.titlePaint = new PaintSample(t.getPaint());
/** * Sets the Paint object being displayed in the panel. * * @param paint the paint. */ public void setPaint(final Paint paint) { this.paint = paint; repaint(); }
/** * Returns the current outline paint. * * @return The current outline paint. */ public Paint getOutlinePaint() { return this.outlinePaintSample.getPaint(); }
/** * Allows the user the opportunity to change the outline paint. */ private void attemptModifyLabelPaint() { Color c; c = JColorChooser.showDialog( this, localizationResources.getString("Label_Color"), Color.blue ); if (c != null) { this.labelPaintSample.setPaint(c); } }
this.labelPaintSample = new PaintSample(axis.getLabelPaint()); this.tickLabelFont = axis.getTickLabelFont(); this.tickLabelPaintSample = new PaintSample(axis.getTickLabelPaint());
/** * Returns the current label paint. * * @return The current label paint. */ public Paint getLabelPaint() { return this.labelPaintSample.getPaint(); }
/** * Allows the user the opportunity to select a new background paint. Uses * JColorChooser, so we are only allowing a subset of all Paint objects to * be selected (fix later). */ private void attemptModifyBackgroundPaint() { Color c; c = JColorChooser.showDialog(this, localizationResources.getString( "Background_Color"), Color.blue); if (c != null) { this.background.setPaint(c); } }