|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent org.sourceforge.espro.elicitation.ElicitationMethod org.sourceforge.espro.elicitation.PieChart
public class PieChart
PieChart is a method where the expert can create a pie chart of her expected probabilities. The probability of 1 is splitted into n pieces which can adjusted to her fits.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class org.sourceforge.espro.elicitation.ElicitationMethod |
---|
frozen, g2, pcs |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PieChart()
Creates a new instance of PieChart |
Method Summary | |
---|---|
protected void |
addSelfListeners()
Adds the listeners the PieChart uses itself. |
protected double |
calcValue(int xPos,
int yPos)
Calculates the Value for the given x/y coordinate. |
java.awt.Color[] |
getColors()
Returns the colors. |
int |
getNPieces()
Returns the number of pieces the pie chart has. |
double |
getRotationBase()
Returns the rotation base. |
java.lang.String[] |
getTexts()
Returns the actual texts in the legend. |
double |
getValue(int index)
Returns a probability value |
double[] |
getValues()
Returns all values. |
protected void |
initialize()
Initializes the PieChart. |
boolean |
isRandom()
DOCUMENT ME! |
boolean |
isShowLegend()
Returns if we want to show the legend. |
boolean |
isShowProbs()
DOCUMENT ME! |
protected void |
paintComponent(java.awt.Graphics g)
Calls the UI delegate's paint method, if the UI delegate is non- null . |
void |
setColors(java.awt.Color[] colors)
Sets the actual color set. |
void |
setNPieces(int nPieces)
Sets the number of pieces the pie chart should have. |
void |
setRandom(boolean random)
DOCUMENT ME! |
void |
setRotationBase(double rotationBase)
Sets the rotation base. |
void |
setShowLegend(boolean showLegend)
Sets if we want to show the legend. |
void |
setShowProbs(boolean showProbs)
DOCUMENT ME! |
void |
setTexts(java.lang.String[] texts)
Sets the actual set of texts for the legend. |
void |
setValue(int index,
double value)
Sets a value. |
void |
setValues(double[] values)
Set the values. |
Methods inherited from class org.sourceforge.espro.elicitation.ElicitationMethod |
---|
addPropertyChangeListener, addPropertyChangeListener, getCategory, getName, isEdit, isFrozen, removePropertyChangeListener, removePropertyChangeListener, setEdit, setFrozen, smothed |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, update, updateUI |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, 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, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PieChart()
Method Detail |
---|
public java.awt.Color[] getColors()
public int getNPieces()
public double getRotationBase()
calcValue(int, int)
public java.lang.String[] getTexts()
public double getValue(int index)
index
- The index of the value to get.
public double[] getValues()
public boolean isRandom()
public boolean isShowLegend()
public boolean isShowProbs()
public void setColors(java.awt.Color[] colors)
colors
- The actual color set.public void setNPieces(int nPieces)
nPieces
- The number of pieces.public void setRandom(boolean random)
random
- DOCUMENT ME!public void setRotationBase(double rotationBase)
rotationBase
- The rotation base.calcValue(int, int)
public void setShowLegend(boolean showLegend)
showLegend
- true if we want to show the legend.public void setShowProbs(boolean showProbs)
showProbs
- DOCUMENT ME!public void setTexts(java.lang.String[] texts)
texts
- The texts.public void setValue(int index, double value)
index
- The index of the value to set.value
- The value.public void setValues(double[] values)
values
- Sets the values.protected void addSelfListeners()
addSelfListeners
in class ElicitationMethod
protected double calcValue(int xPos, int yPos)
xPos
- Mouse x coordinate.yPos
- Mouse y coordinate.
protected void initialize()
initialize
in class ElicitationMethod
protected void paintComponent(java.awt.Graphics g)
null
. We pass the delegate a copy of the
Graphics
object to protect the rest of the paint code from
irrevocable changes (for example, Graphics.translate
).If
you override this in a subclass you should not make permanent changes to
the passed in Graphics
. For example, you should not alter
the clip Rectangle
or modify the transform. If you need to
do these operations you may find it easier to create a new
Graphics
from the passed in Graphics
and
manipulate it. Further, if you do not invoker super's implementation you
must honor the opaque property, that is if this component is opaque, you
must completely fill in the background in a non-opaque color. If you do
not honor the opaque property you will likely see visual artifacts.
The passed in Graphics
object might have a
transform other than the identify transform installed on it. In this
case, you might get unexpected results if you cumulatively apply another
transform.
paintComponent
in class ElicitationMethod
g
- the Graphics
object to protectJComponent.paint(java.awt.Graphics)
,
ComponentUI
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |