public class View3DWindow extends javax.swing.JPanel implements WindowContent, java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.KeyListener, java.awt.event.ActionListener, java.util.Observer, DatabaseChangeListener
javax.swing.JPanel.AccessibleJPaneljavax.swing.JComponent.AccessibleJComponent| Modifier and Type | Field and Description |
|---|---|
protected Cell |
cell
the cell that is in the window
|
protected TransformGroup |
objTrans |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Respond to an action performed, in this case change the current cell
when the user clicks on an entry in the upHierarchy popup menu.
|
void |
addArc(ArcInst ai,
java.awt.geom.AffineTransform transform,
TransformGroup objTrans)
Adds given Arc to scene graph
|
J3DUtils.ThreeDDemoKnot |
addFrame(boolean useView) |
java.util.Map<TransformGroup,BranchGroup> |
addInterpolator(java.util.List<J3DUtils.ThreeDDemoKnot> knotList)
Method to create a path interpolator using knots
defined in input list
|
java.util.Map<TransformGroup,BranchGroup> |
addInterpolatorPerGroup(java.util.List<J3DUtils.ThreeDDemoKnot> knotList,
TransformGroup grp,
java.util.Map<TransformGroup,BranchGroup> interMap,
boolean useView)
Method to add interpolator per group
|
void |
bottomScrollChanged(int e) |
void |
centerCursor()
Method to shift the panels so that the current cursor location becomes the center.
|
static void |
create3DWindow(Cell cell,
WindowFrame wf,
WindowContent view2D,
boolean transPerNode) |
protected BranchGroup |
createSceneGraph(Cell cell)
Method to create main transformation group
|
void |
databaseChanged(DatabaseChangeEvent e)
Invoked in the java AWT Event thread when the database state changes.
|
void |
fillScreen()
Method to reset zoom/rotation/extraTrans to original place (Fill Window operation)
|
boolean |
findNextText(boolean reverse)
Method to find the next occurrence of a string.
|
void |
finished()
Method to get rid of this EditWindow.
|
void |
focusOnHighlighted() |
void |
fullRepaint()
Dummy functios due to text-oriented functions
|
Cell |
getCell()
Method to return the cell that is shown in this window.
|
Highlighter |
getHighlighter()
Get the Highlighter for this window
|
java.awt.Point |
getLastMousePosition() |
void |
getObjTransform(Transform3D trans) |
javax.swing.JPanel |
getPanel()
Method to return the top-level JPanel for this WindowContent.
|
java.awt.image.BufferedImage |
getPrintImage(ElectricPrinter ep)
Method to print window using offscreen canvas.
|
protected double |
getScale() |
boolean |
initializePrinting(ElectricPrinter ep,
java.awt.print.PageFormat pageFormat)
Method to intialize for printing.
|
void |
initTextSearch(java.lang.String search,
boolean caseSensitive,
boolean regExp,
java.util.Set<TextUtils.WhatToSearch> whatToSearch,
CodeExpression.Code codeRestr,
AbstractTextDescriptor.Unit unitRestr,
boolean highlightedOnly)
Method to initialize for a new text search.
|
boolean |
isCollision(Transform3D t3d) |
protected boolean |
isCollision(Vector3d worldCoord)
Method to detect if give x, y location in the world collides with geometry
|
void |
keyPressed(java.awt.event.KeyEvent evt) |
void |
keyReleased(java.awt.event.KeyEvent evt) |
void |
keyTyped(java.awt.event.KeyEvent evt) |
java.util.List<javax.swing.tree.MutableTreeNode> |
loadExplorerTrees() |
void |
mouseClicked(java.awt.event.MouseEvent evt) |
void |
mouseDragged(java.awt.event.MouseEvent evt) |
void |
mouseEntered(java.awt.event.MouseEvent evt) |
void |
mouseExited(java.awt.event.MouseEvent evt) |
void |
mouseMoved(java.awt.event.MouseEvent evt) |
void |
mousePressed(java.awt.event.MouseEvent evt) |
void |
mouseReleased(java.awt.event.MouseEvent evt) |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent evt) |
J3DUtils.ThreeDDemoKnot |
moveAndRotate(double[] values)
Method to rotate individual groups
|
void |
panXOrY(int direction,
double[] panningAmounts,
int ticks)
Method to pan along X according to fixed amount of ticks
|
void |
removeInterpolator(java.util.Map<TransformGroup,BranchGroup> interMap)
Method to remove certain interpolators from scene graph
|
void |
replaceAllText(java.lang.String replace)
Method to replace all selected text.
|
void |
replaceText(java.lang.String replace)
Method to replace the text that was just selected with findNextText().
|
void |
rightScrollChanged(int e) |
void |
saveImage(boolean movieMode) |
void |
saveMovie(java.lang.String filename) |
java.awt.geom.Point2D |
screenToDatabase(int screenX,
int screenY)
Method to convert a screen coordinate to database coordinates.
|
static void |
setAntialiasing(boolean value)
Method to turn on/off antialiasing
|
void |
setCell(Cell cell,
VarContext context,
WindowFrame.DisplayAttributes da) |
void |
setObjTransform(Transform3D trans) |
static void |
setScaleFactor(double value)
Method to change Z values in elements
|
void |
setWindowTitle()
Method to set the window title.
|
void |
setZValues(Layer layer,
java.lang.Double origDist,
java.lang.Double origThick,
java.lang.Double distance,
java.lang.Double thickness)
Method to change geometry of all nodes using this particular layer
This could be an expensive function!.
|
void |
showCoordinates(java.awt.event.MouseEvent evt) |
void |
update(java.util.Observable o,
java.lang.Object arg)
Observer method to highlight 3D nodes by clicking 2D objects
|
void |
writeImage(ElectricPrinter ep,
java.lang.String filePath)
Method to export directly PNG file
|
void |
zoomInContents()
Method to zoom in by a factor of 2 plus mouse pre-defined factor
|
void |
zoomOutContents()
Method to zoom out by a factor of 2 plus mouse pre-defined factor
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, updateadd, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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, transferFocusUpCycleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitrepaint, setCursorprotected TransformGroup objTrans
protected Cell cell
public static void create3DWindow(Cell cell, WindowFrame wf, WindowContent view2D, boolean transPerNode)
public void getObjTransform(Transform3D trans)
public void setObjTransform(Transform3D trans)
protected BranchGroup createSceneGraph(Cell cell)
cell - public void setWindowTitle()
setWindowTitle in interface WindowContentpublic Cell getCell()
getCell in interface WindowContentpublic void finished()
finished in interface WindowContentpublic void bottomScrollChanged(int e)
bottomScrollChanged in interface WindowContentpublic void rightScrollChanged(int e)
rightScrollChanged in interface WindowContentpublic void fullRepaint()
fullRepaint in interface WindowContentpublic boolean findNextText(boolean reverse)
WindowContentfindNextText in interface WindowContentreverse - true to find in the reverse direction.public void replaceText(java.lang.String replace)
WindowContentreplaceText in interface WindowContentreplace - the new text to replace.public javax.swing.JPanel getPanel()
WindowContentgetPanel in interface WindowContentpublic void initTextSearch(java.lang.String search,
boolean caseSensitive,
boolean regExp,
java.util.Set<TextUtils.WhatToSearch> whatToSearch,
CodeExpression.Code codeRestr,
AbstractTextDescriptor.Unit unitRestr,
boolean highlightedOnly)
WindowContentinitTextSearch in interface WindowContentsearch - the string to locate.caseSensitive - true to match only where the case is the same.regExp - true if the search string is a regular expression.whatToSearch - a collection of text types to consider.codeRestr - a restriction on types of Code to consider (null to consider all Code values).unitRestr - a restriction on types of Units to consider (null to consider all Unit values).highlightedOnly - true to search only in the highlighted area.public void panXOrY(int direction,
double[] panningAmounts,
int ticks)
panXOrY in interface WindowContentdirection - panningAmounts - ticks - public void centerCursor()
centerCursor in interface WindowContentpublic void zoomOutContents()
zoomOutContents in interface WindowContentpublic void zoomInContents()
zoomInContents in interface WindowContentpublic void fillScreen()
fillScreen in interface WindowContentpublic void setCell(Cell cell, VarContext context, WindowFrame.DisplayAttributes da)
setCell in interface WindowContentpublic void focusOnHighlighted()
focusOnHighlighted in interface WindowContentpublic void replaceAllText(java.lang.String replace)
WindowContentreplaceAllText in interface WindowContentreplace - the new text to replace everywhere.public Highlighter getHighlighter()
WindowContentgetHighlighter in interface WindowContentpublic java.util.List<javax.swing.tree.MutableTreeNode> loadExplorerTrees()
loadExplorerTrees in interface WindowContentpublic void addArc(ArcInst ai, java.awt.geom.AffineTransform transform, TransformGroup objTrans)
ai - objTrans - public void update(java.util.Observable o,
java.lang.Object arg)
update in interface java.util.Observero - arg - public static void setScaleFactor(double value)
value - public static void setAntialiasing(boolean value)
value - true if antialiasing is set to truepublic void setZValues(Layer layer, java.lang.Double origDist, java.lang.Double origThick, java.lang.Double distance, java.lang.Double thickness)
layer - distance - thickness - public void writeImage(ElectricPrinter ep, java.lang.String filePath)
writeImage in interface WindowContentep - filePath - public void saveImage(boolean movieMode)
public boolean initializePrinting(ElectricPrinter ep, java.awt.print.PageFormat pageFormat)
initializePrinting in interface WindowContentep - the ElectricPrinter object.pageFormat - information about the print job.public java.awt.image.BufferedImage getPrintImage(ElectricPrinter ep)
getPrintImage in interface WindowContentep - printable object.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void mousePressed(java.awt.event.MouseEvent evt)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased in interface java.awt.event.MouseListenerpublic J3DUtils.ThreeDDemoKnot moveAndRotate(double[] values)
values - array of valuespublic void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent evt)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseDragged(java.awt.event.MouseEvent evt)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void showCoordinates(java.awt.event.MouseEvent evt)
public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt)
mouseWheelMoved in interface java.awt.event.MouseWheelListenerpublic void keyPressed(java.awt.event.KeyEvent evt)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent evt)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent evt)
keyTyped in interface java.awt.event.KeyListenerpublic java.awt.Point getLastMousePosition()
public void databaseChanged(DatabaseChangeEvent e)
DatabaseChangeListenerdatabaseChanged in interface DatabaseChangeListenere - database change event.public java.awt.geom.Point2D screenToDatabase(int screenX,
int screenY)
screenX - the X coordinate (on the screen in this EditWindow).screenY - the Y coordinate (on the screen in this EditWindow).public java.util.Map<TransformGroup,BranchGroup> addInterpolator(java.util.List<J3DUtils.ThreeDDemoKnot> knotList)
knotList - list with knot data. If null, search for data attached to nodespublic java.util.Map<TransformGroup,BranchGroup> addInterpolatorPerGroup(java.util.List<J3DUtils.ThreeDDemoKnot> knotList, TransformGroup grp, java.util.Map<TransformGroup,BranchGroup> interMap, boolean useView)
knotList - grp - interMap - public void removeInterpolator(java.util.Map<TransformGroup,BranchGroup> interMap)
interMap - protected double getScale()
public boolean isCollision(Transform3D t3d)
protected boolean isCollision(Vector3d worldCoord)
worldCoord - public J3DUtils.ThreeDDemoKnot addFrame(boolean useView)
public void saveMovie(java.lang.String filename)