Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/main/java/org/jfree/chart/editor/DefaultAxisEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,61 +77,61 @@
class DefaultAxisEditor extends JPanel implements ActionListener {

/** The axis label. */
private JTextField label;
protected JTextField label;

/** The label font. */
private Font labelFont;
protected Font labelFont;

/** The label paint. */
private PaintSample labelPaintSample;
protected PaintSample labelPaintSample;

/** A field showing a description of the label font. */
private JTextField labelFontField;
protected JTextField labelFontField;

/** The font for displaying tick labels on the axis. */
private Font tickLabelFont;
protected Font tickLabelFont;

/**
* A field containing a description of the font for displaying tick labels
* on the axis.
*/
private JTextField tickLabelFontField;
protected JTextField tickLabelFontField;

/** The paint (color) for the tick labels. */
private PaintSample tickLabelPaintSample;
protected PaintSample tickLabelPaintSample;

/**
* An empty sub-panel for extending the user interface to handle more
* complex axes.
*/
private JPanel slot1;
protected JPanel slot1;

/**
* An empty sub-panel for extending the user interface to handle more
* complex axes.
*/
private JPanel slot2;
protected JPanel slot2;

/** A flag that indicates whether or not the tick labels are visible. */
private JCheckBox showTickLabelsCheckBox;
protected JCheckBox showTickLabelsCheckBox;

/** A flag that indicates whether or not the tick marks are visible. */
private JCheckBox showTickMarksCheckBox;
protected JCheckBox showTickMarksCheckBox;

// /** Insets text field. */
// private InsetsTextField tickLabelInsetsTextField;
// protected InsetsTextField tickLabelInsetsTextField;
//
// /** Label insets text field. */
// private InsetsTextField labelInsetsTextField;
// protected InsetsTextField labelInsetsTextField;

/** The tick label insets. */
private RectangleInsets tickLabelInsets;
protected RectangleInsets tickLabelInsets;

/** The label insets. */
private RectangleInsets labelInsets;
protected RectangleInsets labelInsets;

/** A tabbed pane for... */
private JTabbedPane otherTabs;
protected JTabbedPane otherTabs;

/** The resourceBundle for the localization. */
protected static ResourceBundle localizationResources
Expand Down Expand Up @@ -417,7 +417,7 @@ else if (command.equals("SelectTickLabelFont")) {
/**
* Presents a font selection dialog to the user.
*/
private void attemptLabelFontSelection() {
protected void attemptLabelFontSelection() {

FontChooserPanel panel = new FontChooserPanel(this.labelFont);
int result = JOptionPane.showConfirmDialog(this, panel,
Expand All @@ -436,7 +436,7 @@ private void attemptLabelFontSelection() {
/**
* Allows the user the opportunity to change the outline paint.
*/
private void attemptModifyLabelPaint() {
protected void attemptModifyLabelPaint() {
Color c;
c = JColorChooser.showDialog(
this, localizationResources.getString("Label_Color"), Color.BLUE
Expand Down Expand Up @@ -471,7 +471,7 @@ public void attemptTickLabelFontSelection() {
// * individual insets values. Updates the current insets text field if
// * edit is accepted.
// */
// private void editTickLabelInsets() {
// protected void editTickLabelInsets() {
// InsetsChooserPanel panel = new InsetsChooserPanel(
// this.tickLabelInsets);
// int result = JOptionPane.showConfirmDialog(
Expand All @@ -490,7 +490,7 @@ public void attemptTickLabelFontSelection() {
// * individual insets values. Updates the current insets text field if edit
// * is accepted.
// */
// private void editLabelInsets() {
// protected void editLabelInsets() {
// InsetsChooserPanel panel = new InsetsChooserPanel(this.labelInsets);
// int result = JOptionPane.showConfirmDialog(
// this, panel, localizationResources.getString("Edit_Insets"),
Expand Down
50 changes: 42 additions & 8 deletions src/main/java/org/jfree/chart/editor/DefaultChartEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,19 @@
class DefaultChartEditor extends JPanel implements ActionListener, ChartEditor {

/** A panel for displaying/editing the properties of the title. */
private DefaultTitleEditor titleEditor;
protected DefaultTitleEditor titleEditor;

/** A panel for displaying/editing the properties of the plot. */
private DefaultPlotEditor plotEditor;
protected DefaultPlotEditor plotEditor;

/**
* A checkbox indicating whether or not the chart is drawn with
* anti-aliasing.
*/
private JCheckBox antialias;
protected JCheckBox antialias;

/** The chart background color. */
private PaintSample background;
protected PaintSample background;

/** The resourceBundle for the localization. */
protected static ResourceBundle localizationResources
Expand Down Expand Up @@ -179,15 +179,15 @@ public DefaultChartEditor(JFreeChart chart) {

JTabbedPane tabs = new JTabbedPane();

this.titleEditor = new DefaultTitleEditor(title);
this.titleEditor = instantiateTitleEditor(title);
this.titleEditor.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
tabs.addTab(localizationResources.getString("Title"), this.titleEditor);

if (plot instanceof PolarPlot) {
this.plotEditor = new DefaultPolarPlotEditor((PolarPlot) plot);
this.plotEditor = instantiatePolarPlotEditor((PolarPlot) plot);
}
else {
this.plotEditor = new DefaultPlotEditor(plot);
this.plotEditor = instantiatePlotEditor(plot);
}
this.plotEditor.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
tabs.addTab(localizationResources.getString("Plot"), this.plotEditor);
Expand All @@ -196,6 +196,40 @@ public DefaultChartEditor(JFreeChart chart) {
parts.add(tabs, BorderLayout.NORTH);
add(parts);
}

/**
* Instantiates the title editor
* - This can be overridden by a subclass to use a different TitleEditor that inherits DeafultTitleEditor
* @param title
* @return
*/
protected DefaultTitleEditor instantiateTitleEditor(Title title)
{
return new DefaultTitleEditor(title);
}

/**
* Instantiates the DefaultPlotEditor
* - This can be overridden by a subclass to use a different DefaultPlotEditor that inherits DefaultPlotEditor
* @param plot
* @return
*/
protected DefaultPlotEditor instantiatePlotEditor(Plot plot)
{
return new DefaultPlotEditor(plot);
}

/**
* Instantiates the PolarPlotEditor
* - This can be overridden by a subclass to use a different PolarPlotEditor that inherits PolarPlotEditor
* @param plot
* @return
*/
protected DefaultPolarPlotEditor instantiatePolarPlotEditor(PolarPlot plot)
{
return new DefaultPolarPlotEditor(plot);
}


/**
* Returns a reference to the title editor.
Expand Down Expand Up @@ -251,7 +285,7 @@ public void actionPerformed(ActionEvent event) {
* JColorChooser, so we are only allowing a subset of all Paint objects to
* be selected (fix later).
*/
private void attemptModifyBackgroundPaint() {
protected void attemptModifyBackgroundPaint() {
Color c;
c = JColorChooser.showDialog(this, localizationResources.getString(
"Background_Color"), Color.BLUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
*/
public class DefaultLogAxisEditor extends DefaultValueAxisEditor {

private double manualTickUnitValue;
protected double manualTickUnitValue;

private JTextField manualTickUnit;
protected JTextField manualTickUnit;

/**
* Standard constructor: builds a property panel for the specified axis.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
class DefaultNumberAxisEditor extends DefaultValueAxisEditor
implements FocusListener {

private double manualTickUnitValue;
protected double manualTickUnitValue;

private JTextField manualTickUnit;
protected JTextField manualTickUnit;


/**
Expand Down
Loading