|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.sourceforge.espro.elicitation.ElicitationMethod
org.sourceforge.espro.elicitation.FunctionalMethod
public abstract class FunctionalMethod
An abstract class which extends the ElicitationMethod
in order
to make it work with distributions. FunctionalMethods are methods which
have an fX() method, where this calculates a function of x. The abstract
class takes care of painting it correctly on the screen.
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 | |
---|---|
protected boolean |
fitFunction
Wether the function should be fitted into the functional area. |
protected java.util.ArrayList<java.lang.Integer> |
highlight
The list of points to highlight. |
protected java.util.ArrayList<java.lang.Integer> |
markers
Holds a List of markers. |
protected int |
maxMarkers
Maximum of possible markers. |
protected double |
maxValue
The maximum value of the courve will be stored here when running method calcFunction() |
protected double[][] |
points
holds the points |
protected boolean |
showHighlights
Child classes can set if it want to show the highlights or not. |
protected boolean |
showMarkers
Child classes can set if it wants so show markers or not. |
protected double |
standardHeight
A standard height of the function area. |
protected double |
standardWidth
A standard with of the function area. |
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 | |
---|---|
protected |
FunctionalMethod(java.lang.String name,
java.lang.String category)
The constructor for extensions. |
Method Summary | |
---|---|
protected void |
addSelfListeners()
DOCUMENT ME! |
protected void |
calcFunction()
Calculates the points from the function. |
protected void |
calcReals()
Calculates real area. |
protected void |
clearMarkers()
Removes all markers. |
protected void |
drawAxis()
Draws the axis. |
protected void |
drawFilledScaledBox(double[] p)
Draws a filled box arround the given point. |
protected void |
drawFunction()
Draws the Function into the graph. |
protected void |
drawScaledBox(double[] p)
Draws a box arround the given point. |
protected void |
drawStandardLine(double x1,
double y1,
double x2,
double y2)
Draws a small line from the function. |
int |
getDigits()
Returns the digits. |
int |
getMaxMarkers()
Returns the maxMarkers. |
int |
getMaxPoint()
Returns the index of the point that containts the max value. |
double |
getStandardHeight()
DOCUMENT ME! |
double |
getStandardWidth()
DOCUMENT ME! |
protected double[] |
graphicsPoint(double[] p)
Converts a point into the graphics value. |
protected double |
graphicsXPoint(double x)
Calculates the graphics x point from a standard x point. |
protected double |
graphicsYPoint(double y)
Calculates the graphics y point from a standard y point. |
protected int |
highlightNearest(java.awt.Point point,
boolean save)
Highlights the point nearest the given point. |
protected void |
initialize()
An initialize function, which can be used within several constructors. |
boolean |
isFitFunction()
DOCUMENT ME! |
protected int |
nearestPoint(double[] p)
Calculates the nearest point on the courve to the given point. |
protected void |
paintComponent(java.awt.Graphics g)
DOCUMENT ME! |
void |
setDigits(int digits)
Sets the digits |
void |
setFitFunction(boolean fitFunction)
DOCUMENT ME! |
void |
setMaxMarkers(int maxMarkers)
Sets the maxMarkers |
void |
setStandardHeight(double standardHeight)
DOCUMENT ME! |
protected void |
setStandardSize(double width,
double height)
Extensions can change both at once: The width and height of the function area. |
void |
setStandardWidth(double standardWidth)
DOCUMENT ME! |
protected double[] |
standardPoint(double[] p)
Converts a point to the standard values. |
protected double |
standardXPoint(double x)
Calculates the standard x point from a graphics x point. |
protected double |
standardYPoint(double y)
Calculates the standard y point from a graphics y point. |
protected void |
viewBox(double x,
double y)
Draws a box on the given position. |
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 |
Field Detail |
---|
protected java.util.ArrayList<java.lang.Integer> highlight
protected java.util.ArrayList<java.lang.Integer> markers
protected double[][] points
protected boolean fitFunction
protected boolean showHighlights
protected boolean showMarkers
protected double maxValue
calcFunction()
protected double standardHeight
protected double standardWidth
protected int maxMarkers
Constructor Detail |
---|
protected FunctionalMethod(java.lang.String name, java.lang.String category)
name
- The name of the method.category
- The category of the method.Method Detail |
---|
public int getDigits()
public int getMaxMarkers()
public int getMaxPoint()
public double getStandardHeight()
public double getStandardWidth()
public boolean isFitFunction()
public void setDigits(int digits)
digits
- The digits to set.public void setFitFunction(boolean fitFunction)
fitFunction
- The fitFunction to set.public void setMaxMarkers(int maxMarkers)
maxMarkers
- The maxMarkers to set.public void setStandardHeight(double standardHeight)
standardHeight
- The standardHeight to set.public void setStandardWidth(double standardWidth)
standardWidth
- The standardWidth to set.protected void addSelfListeners()
addSelfListeners
in class ElicitationMethod
protected void calcFunction()
protected void calcReals()
protected void clearMarkers()
protected void drawAxis()
protected void drawFilledScaledBox(double[] p)
p
- The point.protected void drawFunction()
protected void drawScaledBox(double[] p)
p
- The point.protected void drawStandardLine(double x1, double y1, double x2, double y2)
x1
- The first x coordinate.y1
- The first y coodrinate.x2
- The second x coordinate.y2
- The second y coordinate.protected double[] graphicsPoint(double[] p)
p
- The standard point.
protected double graphicsXPoint(double x)
x
- The standard x point.
protected double graphicsYPoint(double y)
y
- The standard y point.
protected int highlightNearest(java.awt.Point point, boolean save)
point
- The coordinates to find the nearest point.save
- true if the point should be saved.
protected void initialize()
ElicitationMethod
initialize
in class ElicitationMethod
ElicitationMethod.initialize()
protected int nearestPoint(double[] p)
p
- The point.
protected void paintComponent(java.awt.Graphics g)
ElicitationMethod
paintComponent
in class ElicitationMethod
g
- DOCUMENT ME!JComponent.paintComponent(java.awt.Graphics)
protected void setStandardSize(double width, double height)
width
- The width.height
- The heigth.protected double[] standardPoint(double[] p)
p
- The graphics point.
protected double standardXPoint(double x)
x
- The graphics x point.
protected double standardYPoint(double y)
y
- The graphics y point.
protected void viewBox(double x, double y)
x
- X-axis value.y
- Y-axis value.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |