MxDesignTable
Class com.gp.api.swing.designer.MxDesignTable can be used to edit arbitrary chart's styles.
MxDesignTable is a subclass of JTable with the following additional methods:
- public void setExpertMode(boolean value)
- Sets expert mode that displays the object structure instead of user-friendly dialogs
- public boolean getExpertMode()
- Returns true if expertMode is set, false otherwise
- public void setUseColorSpaces(boolean value)
- When set to true, all color fields upon click display color space popups with standard and
custom colors. Otherwise color dialog is displayed.
- public boolean isUseColorSpaces()
- Returns true if colors spaces are used, false otherwise
- public void expandAll()
- Expands all expandable nodes of the table
- public void collapseAll()
- Collapses all expandable nodes of the table
- public void setTarget(MxStructure style)
- Set's the target style to be edited. This style can be either chart style or any other
chart substyle, including frame, axis, paint and other styles. When the style is null, the
table will not display anything. SetTarget method automatically sets up table's model.
You should not call setModel method of this class directly.
- public MxStructure getTarget()
- Returns the edited style. MxDesignTable neither guarantees to return the original instance
that was passed for editing, nor guarantees to return a true deep copy of this style (i.e. some
subobjects from the original style can be reused). If you want to ensure that the entire object
is either accepted or discarded, pass a copy of the styles as an argument to setTarget method.
For example, it the table is shown in a dialog with "Accept" and "Discard" buttons, use
setTarget(style.copy()) instead of setTarget(style), and assign the new styles to the chart only
if accept button was pressed. Note that MxDesignTable is not aware of any chart
component and if you need to update the actual chart in responce to the table modifications
you will need to add a listener to its model.
For example:
MxDesignTable table = new MxDesignTable();
table.setTarget(myChart.getStyle());
table.getModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent e) {
myChart.repaint();
}
});