public class Chart_1_0 extends JPanel implements DataComponent, IChartComponent
JFreeChart,
Serialized FormJPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected Object |
attribute
A reference to attribute.
|
static int |
AVG
Constant that sets the AVG operation identifier.
|
protected Paint |
backgroundPaint |
protected Paint |
backgroundPlotPaint |
static int |
BAR
Constant that sets the BAR chart identifier.
|
static int |
BAR_3D
Constant that sets the BAR_3D chart identifier.
|
protected ResourceBundle |
bundle |
protected JPanel |
chartComponentPanel
An instance of a chart component panel.
|
protected org.jfree.chart.ChartPanel |
chartPanel
A reference for a chart panel.
|
static String |
COUNT_COLUMN
A key that allows to count the occurrences of a Xaxis value.
|
protected String |
entityName
A reference to a entity name.
|
protected String |
labelX
A reference to X label.
|
protected String |
labelY
A reference to Y label.
|
static int |
LINE
Constant that sets the LINE chart identifier.
|
static int |
MAX
Constant that sets the MAX operation identifier.
|
static int |
MIN
Constant that sets the MIN operation identifier.
|
protected JPanel |
northPanel
An instance of a north panel.
|
static int |
PIE
Constant that sets the PIE chart identifier.
|
static int |
PIE_3D
Constant that sets the PIE_3D chart identifier.
|
protected int |
prefH
The preferred height.
|
protected int |
prefW
The preferred weight.
|
protected JScrollPane |
scroll
An instance of a scroll pane.
|
static int |
STACKED_3D
Constant that sets the STACKED_3D chart identifier.
|
static int |
SUM
Constant that sets the SUM operation identifier.
|
protected String |
title |
protected String[] |
translateSeries |
protected int |
type
The reference to type.
|
protected Hashtable |
value
A reference to value.
|
protected Vector |
visibleSeries
A reference to a visible series.
|
protected String |
xAxesName
A reference to a x Axis name.
|
protected Vector |
yAxesName
A reference to a y Axis name.
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTCOMP_FOCUS_YELLOW, GREEN_VERY_LIGHT, LIGHT_GRAY_BLUE, LIGHT_GREYISH_BLUE, VERY_LIGHT_BLUE, VERY_LIGHT_GRAY, VERY_LIGHT_PINK, VERY_LIGHT_RED, VERY_LIGHT_SKYBLUE, VERY_LIGHT_YELLOW, VERY_LIGHT_YELLOW_2DEBUG_LANGUAGEDESACTIVATE_COMPONENT_BY_PERMISSION_TIPABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
Chart_1_0(Hashtable parameters)
Inits parameters and
Container.setLayout(LayoutManager). |
| Modifier and Type | Method and Description |
|---|---|
void |
add(JPanel chartComponentPanel) |
boolean |
checkXYDataset(String colX,
String[] colY)
Checks the possible inconsistency for pairs x-y dataset values.
|
Object |
createChart()
Creates the chart in function of parameters: type, labelX, labelY,
xAxesName, yAxesName, ...
|
void |
deleteData()
Delete data and calls
updateChart() to repaint. |
Object |
getAttribute()
Returns an #TableAttribute wheter 'entity' parameter is not null.
|
Paint |
getBackgroundPaint()
Gets the paint of background of charts.
|
Paint |
getBackgroundPlotPaint()
Gets the paint of background in plot of charts.
|
Object |
getCategoryDataset(String colX,
String[] colsY,
String[] seriesNames)
Returns the CategoryDataset.
|
Object |
getCategoryDataset(String colX,
String[] colsY,
String[] seriesNames,
int[] operations)
Gets the categoy dataset for chart.
|
Object |
getCategoryDataset(String colX,
String colY,
int operation)
Gets the category dataset.
|
JPanel |
getChartComponentPanel()
Gets the component with chart panel is placed.
|
Object |
getChartPanel()
Defines method that returns where chart panel is drawed
|
Object |
getConstraints(LayoutManager parentLayout)
Returns the constraints to chart to set in the correct position in parent
Container.
|
String |
getLabelComponentText()
Returns the label text component.
|
Object |
getPieDataset(String colX,
String colY)
Calls to
getPieDataset(String, String, int) with operation =
SUM. |
Object |
getPieDataset(String colX,
String colY,
int operation)
Gets the Dataset for pie charts.
|
void |
getPopupMenuComponentsTranslate(Component[] component) |
JScrollPane |
getScrollPane()
Gets the scroll pane where is placed.
|
int |
getSQLDataType()
Returns the
sql data type according to
java.sql.Types
|
Vector |
getTextsToTranslate()
Returns all the texts in the element suitable for being translated.
|
Object |
getValue()
Gets the parameter value.
|
Object |
getXYDataset(String colX,
String[] colY,
String[] series)
Matches the x-y pairs and adds to resultant XYDataSet.
|
void |
init(Hashtable parameters)
This method gets the
Hashtable, processes one by one its
parameters and creates the chart. |
void |
initPermissions() |
boolean |
isEmpty()
Checks the data existence in component.
|
boolean |
isHidden()
Indicates to check the visibility condition for a component.
|
boolean |
isModifiable()
Checks the modifiable condition for a component.
|
boolean |
isModified()
This method should be return
true when data have been
modified. |
boolean |
isRequired()
Indicates the required condition for a component.
|
boolean |
isRestricted() |
String |
MenuLabelName(String string) |
void |
setBackgroundPaint(Paint backgroundPaint)
Sets the paint of background of charts.
|
void |
setBackgroundPlotPaint(Paint backgroundPlotPaint)
Sets the paint of background in plot of charts.
|
void |
setChartPreferredSize(int w,
int h)
Sets the preferred size for chart.
|
void |
setComponentLocale(Locale l) |
void |
setLayout(BorderLayout borderLayout) |
void |
setModifiable(boolean modifiable)
Establishes the modifiable condition for a component.
|
void |
setRequired(boolean required)
Sets required a component according to condition.
|
void |
setResourceBundle(ResourceBundle resources)
Sets the language resource bundle.
|
void |
setSerieVisible(String s,
boolean visible)
Adds to
visibleSeries new visible values aned updates chart. |
void |
setType(int type)
Changes the type of chart and repaints the chart.
|
void |
setValue(Object value)
Sets the value for component.
|
void |
setYAxis(String[] yAxis)
Sets the name or names in Y axis and updates the chart.
|
void |
updateChart()
Repaints the chart.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisEnabled, setEnabled, setVisiblepublic static final String COUNT_COLUMN
public static final int PIE
public static final int PIE_3D
public static final int BAR
public static final int BAR_3D
public static final int STACKED_3D
public static final int LINE
public static final int SUM
public static final int MAX
public static final int MIN
public static final int AVG
protected JPanel northPanel
protected JPanel chartComponentPanel
protected JScrollPane scroll
protected org.jfree.chart.ChartPanel chartPanel
protected Object attribute
protected String xAxesName
protected Vector yAxesName
protected Vector visibleSeries
protected int type
protected Hashtable value
protected String labelX
protected String labelY
protected String entityName
protected int prefW
protected int prefH
protected ResourceBundle bundle
protected String title
protected Paint backgroundPaint
protected Paint backgroundPlotPaint
protected String[] translateSeries
public Chart_1_0(Hashtable parameters)
Container.setLayout(LayoutManager).
parameters - the Hashtable with parameterspublic void setYAxis(String[] yAxis)
setYAxis in interface IChartComponentyAxis - the String Vector with namespublic void setChartPreferredSize(int w,
int h)
setChartPreferredSize in interface IChartComponentw - the widthh - the heightpublic void setSerieVisible(String s, boolean visible)
visibleSeries new visible values aned updates chart.
setSerieVisible in interface IChartComponents - the value to set visiblevisible - Indicates whether other parameter is visiblepublic void init(Hashtable parameters)
Hashtable, processes one by one its
parameters and creates the chart.
init in interface FormComponentparameters - the Hashtable with parameters
| attribute | values | default | required | meaning |
| attr | yes | The attribute. | ||
| entity | no | The entity name. Mandatory when data are obtained from entity. | ||
| xaxis | yes | X axis name. | ||
| yaxis | yes | Y axis name. | ||
| type | line/bar/bar3d/pie/pie3d/stacked3d | line | no | The chart type |
| xlabel | no | The X axis label. | ||
| ylabel | no | The Y axis label. | ||
| width | no | Preferred width size in pixels for chart component. | ||
| height | no | Preferred height size in pixels for chart component. | ||
| title | no | Title to set. | ||
| bgpaint | A paint registered in the ColorConstants class |
no | Paint value to use in the panel when the Chart is contained in | |
| bgplotpaint | A paint registered in the ColorConstants class |
no | Paint to use in the chart plot background | |
| opaque | yes/no | yes | no | Specifies if the chart panel must be opaque or not |
public Object getConstraints(LayoutManager parentLayout)
getConstraints in interface FormComponentgetConstraints in interface IChartComponentparentLayout - the parent Layoutpublic Object getValue()
getValue in interface DataComponentgetValue in interface IChartComponentpublic void setType(int type)
setType in interface IChartComponenttype - type of chartpublic void setValue(Object value)
DataComponentsetValue in interface DataComponentsetValue in interface IChartComponentvalue - the object with value to setpublic void updateChart()
updateChart in interface IChartComponentpublic void deleteData()
updateChart() to repaint.deleteData in interface DataComponentdeleteData in interface IChartComponentpublic boolean isModified()
DataComponenttrue when data have been
modified. The method setValue() should be change this
condition.
isModified in interface DataComponentisModified in interface IChartComponentpublic boolean isRequired()
DataComponentisRequired in interface DataComponentisRequired in interface IChartComponentpublic void setRequired(boolean required)
DataComponentsetRequired in interface DataComponentsetRequired in interface IChartComponentrequired - the required conditionpublic int getSQLDataType()
DataComponentsql data type according to
java.sql.Types
getSQLDataType in interface DataComponentgetSQLDataType in interface IChartComponentInteger typepublic boolean isHidden()
DataComponentisHidden in interface DataComponentisHidden in interface IChartComponentpublic void setModifiable(boolean modifiable)
DataComponentDeleteFields call.
setModifiable in interface DataComponentsetModifiable in interface IChartComponentmodifiable - the boolean conditionpublic boolean isModifiable()
DataComponentisModifiable in interface DataComponentisModifiable in interface IChartComponenttrue when component is modifiablepublic boolean isEmpty()
DataComponentisEmpty in interface DataComponentisEmpty in interface IChartComponenttrue when component is emptypublic String getLabelComponentText()
DataComponentLocale.
getLabelComponentText in interface DataComponentgetLabelComponentText in interface IChartComponentpublic void setComponentLocale(Locale l)
setComponentLocale in interface IChartComponentsetComponentLocale in interface Internationalizationpublic void setResourceBundle(ResourceBundle resources)
InternationalizationsetResourceBundle in interface IChartComponentsetResourceBundle in interface Internationalizationresources - the new language bundle.public void getPopupMenuComponentsTranslate(Component[] component)
public Vector getTextsToTranslate()
InternationalizationgetTextsToTranslate in interface IChartComponentgetTextsToTranslate in interface Internationalizationpublic Object getAttribute()
getAttribute in interface IChartComponentgetAttribute in interface IdentifiedElement#TableAttributepublic void initPermissions()
initPermissions in interface IChartComponentinitPermissions in interface SecureElementpublic boolean isRestricted()
isRestricted in interface IChartComponentisRestricted in interface SecureElementpublic Object createChart()
createChart in interface IChartComponentpublic Object getCategoryDataset(String colX, String[] colsY, String[] seriesNames)
getCategoryDataset in interface IChartComponentgetCategoryDataset(String, String[], String[], int[])public Object getCategoryDataset(String colX, String[] colsY, String[] seriesNames, int[] operations)
getCategoryDataset in interface IChartComponentcolX - the X colcolsY - the Y colsseriesNames - the names of seriesoperations - the operations for applying to the columns. By default
(operations = null), SUM is the operationpublic Object getPieDataset(String colX, String colY)
getPieDataset(String, String, int) with operation =
SUM.
getPieDataset in interface IChartComponentcolX - the x columncolY - the y columnpublic Object getPieDataset(String colX, String colY, int operation)
getPieDataset in interface IChartComponentcolX - the X colcolY - the Y coloperation - One of the possible operations: SUM, AVG, MAX or MINpublic Object getCategoryDataset(String colX, String colY, int operation)
getCategoryDataset in interface IChartComponentcolX - the X colcolY - the Y coloperation - the operationpublic boolean checkXYDataset(String colX, String[] colY)
checkXYDataset in interface IChartComponentcolX - colY - public Object getXYDataset(String colX, String[] colY, String[] series)
getXYDataset in interface IChartComponentcolX - the X colcolY - the Y colsseries - the name of seriespublic Object getChartPanel()
IChartComponentgetChartPanel in interface IChartComponentpublic Paint getBackgroundPaint()
IChartComponentgetBackgroundPaint in interface IChartComponentpublic void setBackgroundPaint(Paint backgroundPaint)
IChartComponentsetBackgroundPaint in interface IChartComponentbackgroundPaint - the background paint to setpublic Paint getBackgroundPlotPaint()
IChartComponentgetBackgroundPlotPaint in interface IChartComponentpublic void setBackgroundPlotPaint(Paint backgroundPlotPaint)
IChartComponentsetBackgroundPlotPaint in interface IChartComponentpublic void add(JPanel chartComponentPanel)
public void setLayout(BorderLayout borderLayout)
public JPanel getChartComponentPanel()
IChartComponentgetChartComponentPanel in interface IChartComponentpublic JScrollPane getScrollPane()
IChartComponentgetScrollPane in interface IChartComponentCopyright © 2016 Imatia Innovation S.L.. All rights reserved.