public class JSurface extends JComponent
JSurface
is responsible for the generation of surface
images and user mouse events handling.JComponent.AccessibleJComponent
Component.BaselineResizeBehavior
Modifier and Type | Field and Description |
---|---|
LineAccumulator |
accumulator |
int |
calc_divisions |
float |
color_factor |
int |
contour_lines |
float |
contour_stepz |
SurfaceVertex[] |
contour_vertex |
SurfaceVertex |
cop |
boolean |
critical |
int |
curve |
boolean |
data_available |
org.freehep.graphics2d.VectorGraphics |
graphics |
boolean |
interrupted |
boolean |
isBoxed |
boolean |
isDisplayGrids |
boolean |
isDisplayXY |
boolean |
isDisplayZ |
boolean |
isMesh |
boolean |
isScaleBox |
JMenuItem |
item1 |
JMenuItem |
item2 |
Color |
line_color |
SurfaceModel |
model |
SurfaceModel.PlotType |
plot_type |
boolean |
plotboth |
boolean |
plotfunc1 |
boolean |
plotfunc2 |
boolean |
printing |
Point |
projection |
Projector |
projector |
SurfaceVertex[][] |
vertex |
float |
xmax |
float |
xmin |
float |
ymax |
float |
ymin |
float |
zmax |
float |
zmin |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
JSurface() |
JSurface(SurfaceModel model)
The constructor of
JSurface |
Modifier and Type | Method and Description |
---|---|
void |
computePlotArea()
Common method for contour plot and density plot that computes the best
plot area size and position.
|
int |
contourConvertX(float x)
Converts normalized x coordinate (-10..+10) to screen x coordinate
|
int |
contourConvertY(float y)
Converts normalized y coordinate (-10..+10) to screen y coordinate
|
void |
createContour()
Creates contour plot of a single area division.
|
void |
destroyImage()
Destroys the internal image.
|
void |
doExportPNG(File file)
mouseDown event handler. |
void |
drawBoundingBox()
Draws the bounding box of surface.
|
void |
drawBoundingRect()
Creates bounding box for images of contour plot or density plot
|
void |
drawBoxGridsTicksLabels(org.freehep.graphics2d.VectorGraphics g2d,
boolean draw_axes)
Draws non-surface parts, i.e: bounding box, axis grids, axis ticks, axis
labels, base plane.
|
JSurface |
getFocusedComponent() |
Dimension |
getPreferredSize()
Returns the preferred size of this object.
|
Projector |
getProjector()
Get projector
|
float[] |
getRanges()
Gets the current x, y, and z ranges.
|
SurfaceColor |
getSurfaceColor() |
SurfaceModel |
getSurfaceModel()
Get model
|
SurfaceVertex[][] |
getValuesArray()
Gets the current vertices array.
|
org.freehep.graphics2d.VectorGraphics |
getVectorGraphics()
Get current graphics
|
void |
paintComponent(Graphics g)
Paints surface.
|
void |
plotArea(int start_lx,
int start_ly,
int end_lx,
int end_ly,
int sx,
int sy)
Plots an area of group of planes
|
void |
setDataAvailability(boolean avail)
Sets the data availability flag.
|
void |
setRanges(float xmin,
float xmax,
float ymin,
float ymax)
Sets the x and y ranges of calculated surface vertices.
|
void |
setValuesArray(SurfaceVertex[][] vertex)
Sets the new vertices array of surface.
|
void |
update(Graphics g)
Updates image.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateUI
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, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
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, getAccessibleContext, 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, 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, transferFocusBackward, transferFocusUpCycle
public SurfaceModel model
public Projector projector
public SurfaceVertex[][] vertex
public boolean data_available
public boolean interrupted
public boolean critical
public boolean printing
public SurfaceVertex cop
public JMenuItem item1
public JMenuItem item2
public int curve
public org.freehep.graphics2d.VectorGraphics graphics
public SurfaceModel.PlotType plot_type
public int calc_divisions
public boolean plotfunc1
public boolean plotfunc2
public boolean plotboth
public boolean isBoxed
public boolean isMesh
public boolean isScaleBox
public boolean isDisplayXY
public boolean isDisplayZ
public boolean isDisplayGrids
public float xmin
public float xmax
public float ymin
public float ymax
public float zmin
public float zmax
public float color_factor
public Point projection
public Color line_color
public int contour_lines
public float contour_stepz
public SurfaceVertex[] contour_vertex
public LineAccumulator accumulator
public JSurface()
public JSurface(SurfaceModel model)
JSurface
SurfaceFrame
public JSurface getFocusedComponent()
public void destroyImage()
SurfaceCanvas
to
regenerate all images when the paint
method is called.public void setRanges(float xmin, float xmax, float ymin, float ymax)
xmin
- the minimum xxmax
- the maximum xymin
- the minimum yymax
- the maximum ypublic float[] getRanges()
public void setDataAvailability(boolean avail)
false
,
SurfaceCanvas
will not generate any surface image, even if
the data is available. But it is the programmer's responsiblity to set
this flag to false
when data is not available.avail
- the availability flagpublic void setValuesArray(SurfaceVertex[][] vertex)
vertex
- the new vertices arraygetValuesArray()
public SurfaceVertex[][] getValuesArray()
setValuesArray(jplot3d.SurfaceVertex[][])
public void doExportPNG(File file) throws IOException
mouseDown
event handler. Sets internal tracking variables
for dragging operations.e
- the eventx
- the x coordinate of cursory
- the y coordinate of cursorIOException
public void paintComponent(Graphics g)
paintComponent
in class JComponent
g
- the graphics context to paint#setContour
,
#setDensity
,
setValuesArray(jplot3d.SurfaceVertex[][])
,
setDataAvailability(boolean)
public void update(Graphics g)
paint
method to avoid flickers.update
in class JComponent
g
- the graphics context to updateJComponent.paint(java.awt.Graphics)
public Dimension getPreferredSize()
SurfaceCanvas
.getPreferredSize
in class JComponent
public final void drawBoundingBox()
public final void drawBoxGridsTicksLabels(org.freehep.graphics2d.VectorGraphics g2d, boolean draw_axes)
g
- the graphics context to drawdraw_axes
- if true
, only draws base plane and z axispublic final void plotArea(int start_lx, int start_ly, int end_lx, int end_ly, int sx, int sy)
start_lx
- start index in x directionstart_ly
- start index in y directionend_lx
- end index in x directionend_ly
- end index in y directionsx
- step in x directionsy
- step in y directionpublic final int contourConvertX(float x)
x
- the normalized x coordinatepublic final int contourConvertY(float y)
y
- the normalized x coordinatepublic final void drawBoundingRect()
public final void computePlotArea()
public final void createContour()
plotContour
method#plotContour
public Projector getProjector()
public SurfaceColor getSurfaceColor()
public SurfaceModel getSurfaceModel()
public org.freehep.graphics2d.VectorGraphics getVectorGraphics()
Jas4pp 1.5 © Java Analysis Studio for Particle Physics