|
|||||||||
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
javax.swing.JPanel
com.quinncurtis.chart3djava.ChartView
public class ChartView
The ChartView class maintains a list of all chart objects and renders the chart object list when the class draw method is called. It is a concrete subclass of the JPanel class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 | |
---|---|
ChartView()
The default ChartView constructor. |
|
ChartView(java.awt.Rectangle positionRect,
javax.swing.JFrame parent)
A ChartView constructor. |
|
ChartView(java.awt.Rectangle positionRect,
javax.swing.JPanel parent)
A ChartView constructor. |
|
ChartView(java.awt.Rectangle positionRect,
javax.swing.JTabbedPane parent)
A ChartView constructor. |
Method Summary | |
---|---|
int |
addChartObject(GraphObj chartobj)
This method adds an GraphObj (or any concrete subclass of GraphObj) to the end of the chartObjectsVector list. |
double |
calcResizedWindowFontMultiplier(java.awt.Dimension preferreddim,
java.awt.Dimension actualdim)
Calculates the value of the resizeMultiplier, based on the component view resize mode, the preferred size of the component, and the actual size of the component. |
java.lang.Object |
clone()
Returns an object that is a clone of this ChartView object. |
void |
copy(ChartView source)
Copies the source scale. |
boolean |
deleteChartObject(GraphObj chartobj)
This method deletes the first instance of an GraphObj (or any concrete subclass of GraphObj) from chartObjectsVector list. |
void |
draw(java.awt.Graphics2D g2)
The draw method for this class. |
void |
drawObject(java.awt.Graphics2D g2,
GraphObj graphobject,
ChartRectangle3D viewrect)
A single DChartGraph objects is rendered to the specified graphics context. |
void |
enabledNoDraw(java.awt.Graphics2D g2)
The draw method for this class. |
GraphObj |
findObj(ChartPoint3D testpoint,
java.lang.String classname)
This method finds the chart object intersecting the test point. |
GraphObj |
findObj(ChartPoint3D testpoint,
java.lang.String classname,
int nthhit)
This method finds the chart object intersecting the test point. |
boolean |
getBackgroundDrawEnable()
Returns the printer background print mode. |
java.util.Vector |
getChartObjectsVector()
This method returns a reference to the vChartObject vector that holds all of the GraphObj objects added to the current view. |
static java.awt.Dimension |
getDefaultPreferredSize()
Returns the default preferred, or initial size, of the component. |
double |
getFractionalZViewportDepth()
Get the Z Depth dimension as a fraction of the viewport width. |
static java.lang.String |
getLicensePath()
Returns the path that the QCLicenseJava.lic.xml file is found on. |
java.awt.Dimension |
getMinimumSize()
This method returns the minimum allowable size for the component. |
java.awt.Dimension |
getPreferredSize()
This method returns the preferred, or initial size, for the component. |
java.awt.RenderingHints |
getRenderingHints()
This method returns the rendering hints used by the graphics context. |
int |
getRenderQuality()
Get the rendering quality as RENDER_HIGHQUALITY, RENDER_STANDARDQUALITY, RENDER_LOWQUALITY |
int |
getResizeMode()
Returns the resize mode. |
double |
getResizeMultiplier()
Returns the resizeMultiplier property. |
java.awt.Rectangle |
getViewport()
This method returns a rectangle containing the current viewport. |
boolean |
getZOrderSortEnable()
Returns true if z-order sorting is enabled. |
void |
paintBorder(java.awt.Graphics g)
This method renders the borders added to the ChartView. |
void |
paintComponent(java.awt.Graphics g)
The paint method renders the current graph in the ChartView window. |
void |
paintComponents(java.awt.Graphics g)
This method renders the components added to the ChartView. |
void |
postDraw(java.awt.Graphics2D g2)
The PostDraw method is called in the ChartView.Draw method AFTER all objects in the chartObjectsArrayList list are rendered to the specified graphics context. |
void |
preDraw(java.awt.Graphics2D g2)
The PreDraw method is called in the ChartView.Draw method BEFORE all objects in the chartObjectsArrayList list are rendered to the specified graphics context. |
void |
resetChartObjectList()
This method empties all of the chart objects out of the display list. |
void |
resetPreviousChartObjectList()
This method empties all of the chart objects out of the previous display list. |
void |
resetViewport()
Sets the value of the current viewport to null. |
void |
setBackgroundDrawEnable(boolean background)
Specifies the printer background print mode. |
static void |
setDefaultPreferredSize(java.awt.Dimension size)
Sets the default preferred, or initial size, of the component. |
void |
setFractionalZViewportDepth(double value)
Set the z-dimension of the viewport depth as a fraction of the viewport width. |
static void |
setLicensePath(java.lang.String value)
Specifies the path that the QCLicenseJava.lic.xml file is found on. |
void |
setMinimumSize(java.awt.Dimension size)
Sets the minimum allowable size for the component. |
void |
setPreferredSize(java.awt.Dimension size)
Sets the preferred, or initial size, of the component. |
void |
setPreferredSize(int w,
int h)
Sets the preferred, or initial size, of the component. |
void |
setRenderingHints(java.awt.RenderingHints hints)
This method sets the rendering hints used by the graphics context. |
void |
setRenderQuality(int value)
Set the rendering quality as RENDER_HIGHQUALITY, RENDER_STANDARDQUALITY, RENDER_LOWQUALITY. |
void |
setResizeMode(int mode)
Sets the resize mode. |
void |
setResizeMultiplier(double multiplier)
Explicitly sets the resizeMultiplier property. |
void |
setZOrderSortEnable(boolean enable)
Enable/Disables the z-order sorting of the graph objects in the chartObjectsVector array. |
void |
sortChartObjectsByZOrder()
This method sorts the objects in the chartObjectsVector array in the ascending value of their z-order. |
void |
updateDraw()
This method forces a redraw of the chart view within tm milliseconds. |
void |
updateDraw(long tm)
This method forces a redraw of the chart view within tm milliseconds. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, 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, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ChartView()
public ChartView(java.awt.Rectangle positionRect, javax.swing.JFrame parent)
positionRect
- Specifies the position of ChartView in the parent Form.parent
- The parent form the ChartView is placed in.public ChartView(java.awt.Rectangle positionRect, javax.swing.JPanel parent)
positionRect
- Specifies the position of ChartView in the parent Form.parent
- The parent form the ChartView is placed in.public ChartView(java.awt.Rectangle positionRect, javax.swing.JTabbedPane parent)
positionRect
- Specifies the position of ChartView in the parent Form.parent
- The parent tab page the ChartView is placed in.Method Detail |
---|
public void copy(ChartView source)
source
- The source scale object.public java.lang.Object clone()
clone
in class java.lang.Object
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- The graphics context.public void paintComponents(java.awt.Graphics g)
paintComponents
in class java.awt.Container
g
- The graphics context.public void paintBorder(java.awt.Graphics g)
paintBorder
in class javax.swing.JComponent
g
- The graphics context.public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public void setPreferredSize(java.awt.Dimension size)
setPreferredSize
in class javax.swing.JComponent
size
- Sets the preferred, or initial size, of the component.public void setPreferredSize(int w, int h)
w
- Sets the preferred, or initial width, of the component.h
- Sets the preferred, or initial height, of the component.public void setMinimumSize(java.awt.Dimension size)
setMinimumSize
in class javax.swing.JComponent
size
- Returns the minimum allowable size for the component.public void resetViewport()
public java.awt.Rectangle getViewport()
public int addChartObject(GraphObj chartobj)
chartobj
- This object is added to the end of the chartObjectsVector list.
public boolean deleteChartObject(GraphObj chartobj)
chartobj
- The first instance of this object is deleted to the chartObjectsVector list.
public void resetChartObjectList()
public void resetPreviousChartObjectList()
public double calcResizedWindowFontMultiplier(java.awt.Dimension preferreddim, java.awt.Dimension actualdim)
preferreddim
- The preferred size of the component.actualdim
- The actual size of the component.
public void updateDraw(long tm)
tm
- The time in milliseconds.public void updateDraw()
public void sortChartObjectsByZOrder()
public void drawObject(java.awt.Graphics2D g2, GraphObj graphobject, ChartRectangle3D viewrect)
g2
- The graphics context.graphobject
- The graphics object to be rendered.viewrect
- The viewport the graphics object is rendered in.public void setRenderingHints(java.awt.RenderingHints hints)
hints
- The hints used for rendering.public java.awt.RenderingHints getRenderingHints()
public void enabledNoDraw(java.awt.Graphics2D g2)
g2
- The graphics context.public void draw(java.awt.Graphics2D g2)
g2
- The graphics context.public void preDraw(java.awt.Graphics2D g2)
g2
- The graphics context.public void postDraw(java.awt.Graphics2D g2)
g2
- The graphics context.public java.util.Vector getChartObjectsVector()
public GraphObj findObj(ChartPoint3D testpoint, java.lang.String classname)
testpoint
- The current position of the mouse in Java user coordinates.classname
- The class name of the base class that
is used to filter the desired class objects. The string "DChartPlot" would
cause the routine to return only object derived from the DChartPlot class.
public GraphObj findObj(ChartPoint3D testpoint, java.lang.String classname, int nthhit)
testpoint
- The current position of the mouse in Java user coordinates.classname
- The class name of the base class that
is used to filter the desired class objects. The string "DChartPlot" would
cause the routine to return only object derived from the DChartPlot class.nthhit
- Specifies to return the nth object that intersects the test point. A value of 0
signifies that the first object found is returned, a value of 1 specifies that the second
item found is returned, and so on.
public void setZOrderSortEnable(boolean enable)
enable
- Set to true to enable z-order sorting.public boolean getZOrderSortEnable()
public void setResizeMultiplier(double multiplier)
multiplier
- The resizeMultiplier is set to this value.public double getResizeMultiplier()
public void setResizeMode(int mode)
mode
- Sets the resize mode.public int getResizeMode()
public void setBackgroundDrawEnable(boolean background)
background
- Specifies the printer background print mode.public boolean getBackgroundDrawEnable()
public static void setLicensePath(java.lang.String value)
value
- Specifies the path that the QCLicenseJava.lic.xml file is found on.public static java.lang.String getLicensePath()
public static void setDefaultPreferredSize(java.awt.Dimension size)
size
- Sets the default preferred, or initial size, of the component.public static java.awt.Dimension getDefaultPreferredSize()
public double getFractionalZViewportDepth()
public void setFractionalZViewportDepth(double value)
value
- Specifies the z-dimension of the viewport depth as a fraction of the viewport width.public int getRenderQuality()
public void setRenderQuality(int value)
value
- Render quality.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |