Package overit.geocall.basic.ui.control
Class JFCPie
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.Container
overit.geocall.basic.ui.control.JFCPie
- All Implemented Interfaces:
Serializable,Cloneable,org.jfree.chart.labels.PieToolTipGenerator,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,AjaxableComponent,Arrangeable,Badgeable,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
@Component
public class JFCPie
extends Container
implements Arrangeable, org.jfree.chart.labels.PieToolTipGenerator, AjaxableComponent, Cloneable, Serializable
This class implements the pie chart object, using the JFreeChart library
- See Also:
- GCApi:
- component
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ArrayListprotected booleanprotected JFCStyleprotected booleanprotected Stringprotected ListAttributeprotected intprotected intprotected ConcreteGateprotected doubleprotected Stringprotected overit.geocall.charts.ChartLabelBoxprotected overit.geocall.charts.ChartFontprotected Stringprotected ListAttributeLabels used for the elements of the chart.protected Stringprotected doubleprotected Stringprotected ListAttributeTooltip messages used for the elements of the chart.protected ListAttributeprotected booleanprotected overit.geocall.charts.ChartLegendBoxprotected overit.geocall.charts.ChartFontprotected ConcreteGateprotected Stringprotected overit.geocall.charts.Serieprotected booleanprotected overit.geocall.charts.ChartFontprotected ListAttributeprotected longprotected intstatic final StringDefines the path that must be used byFactory.make(java.lang.String, java.lang.Object)protected Stringprotected booleanFields inherited from class overit.geocall.basic.ui.Container
_rofields, _rules, DALINK_NO, DALINK_YES, DATE_MAX, DATE_MIN, TIME_MAX, TIME_MIN, TYPE_ACTION, TYPE_BOOLEAN, TYPE_DATE, TYPE_DOUBLE, TYPE_DTZ, TYPE_EURO, TYPE_FILE, TYPE_FILES, TYPE_INTEGER, TYPE_LONG, TYPE_LONGARRAY, TYPE_MAP, TYPE_MAXDATE, TYPE_MAXTIME, TYPE_MEASURE, TYPE_MINDATE, TYPE_MINTIME, TYPE_NEWACTION, TYPE_STRING, TYPE_STRINGARRAY, TYPE_SUBSET, TYPE_SUBSETRANGE, TYPE_SUPPORT, TYPE_TIMERANGEFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineServiceFields inherited from interface overit.geocall.ui.AjaxableComponent
FRAME_ID_PREFIX, NOTRANSITION, TRANSITION_BODY_MORPH, TRANSITION_BODY_RESIZE, TRANSITION_BORDER_RESIZE, TRANSITION_DOWN, TRANSITION_UP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidSets the aria-description attribute.voidEvery component can add a script to the StringBuilder, script executed when the component is created.voidchanged(overit.geocall.ux.servlet.processor.Change change) Defines the morphing of the element that occurs when there is an Ajax interactiongenerateToolTip(org.jfree.data.general.PieDataset pd, Comparable key) protected Object[]getBaseFields(int v) protected Stringorg.apache.ecs.ElementgetContentHtml(Object generationhandle, EntitySet es) Returns the html code that represents the active part of the component, i.e. the field and the validation scriptsgetCopy()Clones the JFCPie objectoverit.geocall.ux.servlet.processor.ChangeDefines the defaultChangeobject for the elementorg.apache.ecs.ElementgetDescriptionHtml(Object generationhandle, EntitySet es) Returns the html code that represents the component description i.e. the formatted label of the fieldgetEvent()Returns the name of the event triggered when the user clicks on an element of the legend boxReturns theListAttributethat contains the exploded state of the elements of the pie chartorg.apache.ecs.ElementgetFrameHtml(overit.geocall.ux.servlet.processor.Change c, EntitySet es) Defines the html part of the element that changes when an Ajax interaction occursReturns the object to generate when the Arrangeable element is composed by more than one elementorg.apache.ecs.ElementgetHiddenHtml(Object generationhandle, EntitySet es) Returns the hidden but active html part of an hidden componentorg.apache.ecs.ElementReturns the html code of the Containerprotected ConcreteGateReturns the labels used for the elements of the chart.Returns the tooltip messages used for the elements of the chart.protected ArrayListprotected JFCStyleReturns the labels used in the legend boxprotected ConcreteGateprotected static org.apache.ecs.ElementgetMessages(ArrayList messages, EntitySet es) org.jfree.chart.JFreeChartCreates the pie chartReturns the tooltip messages used for the elements of the legend boxprotected voidbooleanonExplode(HashGetter hg) Changes (explodes or reduce) the exploded status of the desired item, maintaining unchanged the explode status of the other itemsbooleanonLabel(HashGetter hg) Shows the label of the desired elementbooleanChanges (explodes or reduce) the exploded status of the desired item, setting to "not exploded" the status of all the other itemsbooleanShows the label of the desired element and hides all the other labelsprotected voidvoidControls anti alias in chart renderingvoidDefines if the chart will have a three dimensional design or notvoidSets the name of the event triggered when the user clicks on an element of the legend boxvoidsetEXPLODES(String vals) Defines which are the elements of the pie chart that must be explodedvoidDefines the format of the image that will be createdvoidSets the height of the chartvoidSets the interior gap, the space between the edges of the pie chartand the plot area itself (the region where the section labels appear)voidSets theTextFormatused for the alternative text attributes that appears into the area element of the graph (it's used for accessibility).voidSets the name of the event triggered when the user clicks on an element of the chartvoidDefines the characteristics of the label boxesvoidSets the font used for the label of the items of the chartvoidSets theTextFormatused for the labels of the elements of the chartvoidSets the labels used for the elements of the chartvoidSets the param for the event triggered when the user clicks on an element of the chartvoidDefines the size of the legend itemsvoidSets theTextFormatused for the tooltip message that appears when the user stay with the cursor on an element of the chartvoidSets the tooltip messages used for the elements of the chart.voidsetJFCStyle(JFCStyle cs) Sets theJFCStyleused to draw the pie chart elementsvoidSets the labels used in the legend boxvoidDefines if the chart will have the legend box or notvoidDefines the characteristics of the legend boxvoidSets the font used for the element of the legend boxvoidSets the param for the event triggered when the user clicks on an element of the legend boxvoidDefines if the chart will be a ring chart, and the size of the ring's sectionvoidsetSerie(overit.geocall.charts.Serie s) Sets the dataSerieof the chartvoidDefines if the chart will have a shadow or notvoidSets the font used for the title of the chartvoidSets the tooltip messages used for the elements of the legend box.protected voidsetup()Setup the ComponentvoidSets the values of the data serie of the chartvoidSets the width of the chartMethods inherited from class overit.geocall.basic.ui.Container
alert, applyRule, getBASIC, getBLANK, getRO, getROField, onClose, onOpen, onOpenChildContainer, onRestore, onRule, prepareName, rulesNewValues, setROField, setValues, setValuesMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getCleaner, getConfigurableProperties, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isImportant, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setConfiguredProperty, setDBLINK, setENABLED, setFUNCTION, setModelProperties, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, buildDisplayScript, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, connect, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setICON, setIdentity, setIMPORTANT, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIcon
-
Field Details
-
FACTORY_PATH
Defines the path that must be used byFactory.make(java.lang.String, java.lang.Object)- See Also:
-
_imageGate
-
_mapGate
-
_version
protected long _version -
_width
protected int _width -
_height
protected int _height -
_interiorGap
protected double _interiorGap -
_ddd
protected boolean _ddd -
_shadow
protected boolean _shadow -
_legend
protected boolean _legend -
_legendFont
protected overit.geocall.charts.ChartFont _legendFont -
_legendBox
protected overit.geocall.charts.ChartLegendBox _legendBox -
_itemSize
protected double _itemSize -
_titleFont
protected overit.geocall.charts.ChartFont _titleFont -
_serie
protected overit.geocall.charts.Serie _serie -
_explodes
-
_labels
-
_tooltips
-
_event
-
_param
-
_itemLabelFormat
-
_itemTooltipFormat
-
itemAltFormat
-
removeAreaTooltip
protected boolean removeAreaTooltip -
_antiAlias
protected boolean _antiAlias -
_itemLabels
Labels used for the elements of the chart. AListAttributein which every element, separated from the others by the | character, represents the label of an element of the data serie -
_itemTooltips
Tooltip messages used for the elements of the chart. The tooltip will appear when the user stay with the cursor on an element of the chart. AListAttributein which every element, separated from the others by the | character, represents the message that will appear as a tooltip for the element -
_itemLabelFont
protected overit.geocall.charts.ChartFont _itemLabelFont -
_itemLabelBox
protected overit.geocall.charts.ChartLabelBox _itemLabelBox -
_itemEvent
-
_itemParam
-
_alJFCMessages
-
_format
protected int _format -
_cs
-
-
Constructor Details
-
JFCPie
public JFCPie()
-
-
Method Details
-
generateToolTip
- Specified by:
generateToolTipin interfaceorg.jfree.chart.labels.PieToolTipGenerator
-
getBaseFields
-
invalidateCurrentRaw
protected void invalidateCurrentRaw() -
getJFCStyle
-
setJFCStyle
Sets theJFCStyleused to draw the pie chart elements- Parameters:
cs- The style used to draw the elements of the chart
-
getCopy
Clones the JFCPie object- Returns:
- A clone of the object
-
setRING
Defines if the chart will be a ring chart, and the size of the ring's section- Parameters:
s- A double value that defines the size of the ring's section. If the value is 0 (that is the default value), the chart will be a pie chart, otherwise it will be a ring chart
-
setFORMAT
Defines the format of the image that will be created- Parameters:
s-JFCRaw.PNGto create a PNG image,JFCRaw.JPEGto create a JPEG image. The default value isJFCRaw.PNG
-
setITEMLABELFORMAT
Sets theTextFormatused for the labels of the elements of the chart- Parameters:
s- A string that defines the format used for the labels. The pie chart has only a single serie of data, therefore the format is unique.
-
setITEMLABELS
Sets the labels used for the elements of the chart- Parameters:
s- AListAttributein which every element, separated from the others by the | character, represents the label of an element of the data serie.
-
getItemLabels
Returns the labels used for the elements of the chart.- Returns:
- The
ListAttributethat contains the labels used for the elements of the chart.
-
setITEMTOOLTIPFORMAT
Sets theTextFormatused for the tooltip message that appears when the user stay with the cursor on an element of the chart- Parameters:
s- A string that defines the format used for the tooltip messages. The pie chart has only a single serie of data, therefore the format is unique.
-
setITEMALTFORMAT
Sets theTextFormatused for the alternative text attributes that appears into the area element of the graph (it's used for accessibility).- Parameters:
s- AListAttributein which every element, separated from the others by the | character, represents the format used for the alt attribute of the area elements of the graph.
-
setITEMTOOLTIPS
Sets the tooltip messages used for the elements of the chart. The tooltip will appear when the user stay with the cursor on an element of the chart- Parameters:
s- AListAttributein which every element, separated from the others by the | character, represents the message that will appear as a tooltip for the element of the data serie
-
getItemTooltips
Returns the tooltip messages used for the elements of the chart.- Returns:
- The
ListAttributethat contains the tooltip messages used for the elements of the chart.
-
setITEMEVENT
Sets the name of the event triggered when the user clicks on an element of the chart- Parameters:
s- A string that represents the name of an event. The pie chart has only a single serie of data, therefore the event is unique
-
setITEMPARAM
Sets the param for the event triggered when the user clicks on an element of the chart- Parameters:
s- A string that represents the param for the event. The pie chart has only a single serie of data, therefore there can be only one event, with only one parameter
-
setDDD
Defines if the chart will have a three dimensional design or not- Parameters:
s- A string that represents a boolean value ("true" or "1", "false" or "0").
If the string is not recognized as a boolean value, it will be used the default value, that isfalse
-
setSHADOW
Defines if the chart will have a shadow or not- Parameters:
s- A string that represents a boolean value ("true" or "1", "false" or "0").
If the string is not recognized as a boolean value, it will be used the default one, that istrue
-
setLEGEND
Defines if the chart will have the legend box or not- Parameters:
s- A string that represents a boolean value ("true" or "1", "false" or "0").
If the string is not recognized as a boolean value, it will be used the default one, that istrue
-
setLEGENDFONT
Sets the font used for the element of the legend box- Parameters:
s- A string that defines the font, with the format:name,variant,dimension,color.
The possible values for the variation of the font are:i(italic) andb(bold). It is possible to use both the values, likeiborbito obtain the font both bold and italic.
The format for the color is described in theJFCStyleclass.
You can omit some values, in which case you fall back to the default ones. The default font setting is:Tahoma,plain,12,#000000
-
setTITLEFONT
Sets the font used for the title of the chart- Parameters:
s- A string that defines the font, with the format:name,variant,dimension,color. SeesetLEGENDFONT(java.lang.String)
-
setLEGENDBOX
Defines the characteristics of the legend box- Parameters:
s- A string that defines the format.
It must be composed by a serie of strings, separated by the comma, with the following meaning:position,background color,border thickness,border color.
The possible values for the position are:t(top),b(bottom),l(left),r(right).
The format for the colors is described in theJFCStyleclass.
The thickness value must be a number.
You can omit some values, in which case you fall back to the default ones
-
setITEMSIZE
Defines the size of the legend items- Parameters:
s- s A double value that defines the size of the items of the legend. The default value is 6.
-
setLABELS
Sets the labels used in the legend box- Parameters:
s- AListAttributein which every element, separated from the others by the | character, represents the label that will appear in the legend box
-
getLabels
Returns the labels used in the legend box- Returns:
- The
ListAttributethat contains the labels used in the legend box
-
setTOOLTIPS
Sets the tooltip messages used for the elements of the legend box. The tooltip will appear when the user stay with the cursor on an element of the legend box- Parameters:
s- AListAttributein which every element, separated from the others by the | character, represents the message that will appear as a tooltip for the element of the legend box
-
getTooltips
Returns the tooltip messages used for the elements of the legend box- Returns:
- The
ListAttributethat contains the tooltip messages used for the elements of the legend box
-
setEVENT
Sets the name of the event triggered when the user clicks on an element of the legend box- Parameters:
s- A string that represents the name of an event
-
setPARAM
Sets the param for the event triggered when the user clicks on an element of the legend box- Parameters:
s- A string that represents the param for the event
-
getEvent
Returns the name of the event triggered when the user clicks on an element of the legend box- Returns:
- The string that represents the name of the event
-
setVALUES
Sets the values of the data serie of the chart- Parameters:
vals- AListAttributein which every element, separated from the others by the | character, represents one value of the data serie
-
setSerie
public void setSerie(overit.geocall.charts.Serie s) Sets the dataSerieof the chart- Parameters:
s- The data serie that contains the values of the chart
-
setEXPLODES
Defines which are the elements of the pie chart that must be exploded- Parameters:
vals- AListAttributein which every element, separated from the others by the | character, represents the exploded state of the corresponding item. To explode an item the exploded state must be set to 1.
If the number of the elements of the ListAttribute is less then the number of the items of the data serie, the last value will be replicated for all the remaining items.
-
getExplodes
Returns theListAttributethat contains the exploded state of the elements of the pie chart- Returns:
- The exploded state of the element of the pie chart
-
setWIDTH
Sets the width of the chart- Parameters:
s- The width of the chart, expressed in pixel. The default value is 400
-
setINTERIORGAP
Sets the interior gap, the space between the edges of the pie chartand the plot area itself (the region where the section labels appear)- Parameters:
s- The gap as a percentage of the available drawing space
-
setHEIGHT
Sets the height of the chart- Parameters:
s- The height of the chart, expressed in pixel. THe default value is 300
-
setITEMLABELFONT
Sets the font used for the label of the items of the chart- Parameters:
s- A string that defines the font, with the format:name,variant,dimension,color. SeesetLEGENDFONT(java.lang.String)
-
setITEMLABELBOX
Defines the characteristics of the label boxes- Parameters:
s- A string in the format:background-color,shadow color,border thickness,link thickness,link color.
The format for the colors is described in theJFCStyleclass.
The thickness values must be numbers.
You can omit some values, in which case you fall back to the default ones
-
setANTIALIAS
Controls anti alias in chart rendering- Parameters:
b- A string that represents a boolean value ("true" or "1", "false" or "0").
If the string is not recognized as a boolean value, it will be used the default value, that istrue
-
ARIADESCRIPTION
Sets the aria-description attribute.- Parameters:
s- the aria-description attribute to be set.
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
getHiddenHtml
Description copied from interface:ArrangeableReturns the hidden but active html part of an hidden component- Specified by:
getHiddenHtmlin interfaceArrangeable- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the hidden part of the component
-
getHtml
Description copied from class:ContainerReturns the html code of the Container -
getGenerationHandle
Description copied from interface:ArrangeableReturns the object to generate when the Arrangeable element is composed by more than one element- Specified by:
getGenerationHandlein interfaceArrangeable- Returns:
- The Object to generate
-
getDescriptionHtml
Description copied from interface:ArrangeableReturns the html code that represents the component description i.e. the formatted label of the field- Specified by:
getDescriptionHtmlin interfaceArrangeable- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the label of the field
-
prepareGates
protected void prepareGates() -
getImageGate
-
getMapGate
-
getPieChart
public org.jfree.chart.JFreeChart getPieChart()Creates the pie chart- Returns:
- The
JFreeChartinstance of the pie chart
-
getChartName
-
getFrameHtml
public org.apache.ecs.Element getFrameHtml(overit.geocall.ux.servlet.processor.Change c, EntitySet es) Description copied from interface:AjaxableComponentDefines the html part of the element that changes when an Ajax interaction occurs- Specified by:
getFrameHtmlin interfaceAjaxableComponent- Parameters:
c- TheChangeobject that defines the specific morphing type for the elementes- TheEntitySetto which the element belongs- Returns:
- The html part of the element that changes when an Ajax interaction occurs
-
getContentHtml
Description copied from interface:ArrangeableReturns the html code that represents the active part of the component, i.e. the field and the validation scripts- Specified by:
getContentHtmlin interfaceArrangeable- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the component
-
getJFCMessages
-
getMessages
-
changed
public void changed(overit.geocall.ux.servlet.processor.Change change) Description copied from interface:AjaxableComponentDefines the morphing of the element that occurs when there is an Ajax interaction- Specified by:
changedin interfaceAjaxableComponent- Parameters:
change- TheChangeobject that defines the specific morphing type for the element
-
getDefaultChange
public overit.geocall.ux.servlet.processor.Change getDefaultChange()Description copied from interface:AjaxableComponentDefines the defaultChangeobject for the element- Specified by:
getDefaultChangein interfaceAjaxableComponent- Returns:
- The default
Changeobject that defines the default morphing type of the element
-
buildSetupScript
Description copied from class:ComponentEvery component can add a script to the StringBuilder, script executed when the component is created.- Overrides:
buildSetupScriptin classComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-
onExplode
Changes (explodes or reduce) the exploded status of the desired item, maintaining unchanged the explode status of the other items- Parameters:
hg- TheHashGetterthat contains the number of the element to explode or reduce- Returns:
false
-
onSingleExplode
Changes (explodes or reduce) the exploded status of the desired item, setting to "not exploded" the status of all the other items- Parameters:
hg- TheHashGetterthat contains the number of the element to explode or reduce- Returns:
false
-
onLabel
Shows the label of the desired element- Parameters:
hg- TheHashGetterthat contains the number of the element- Returns:
true
-
onSingleLabel
Shows the label of the desired element and hides all the other labels- Parameters:
hg- TheHashGetterthat contains the number of the element- Returns:
true
-