|
||||||||
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 javax.swing.JPanel JHeightMap.JPanelMap
public class JPanelMap
Class JPanelMap represents a third level in the draft JHeightMap library. This level is designed to display a height map and create 3D scene.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
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 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 | |
---|---|
JPanelMap(JHeightMap.AbstractHeightMap map)
The constructor creates graph scene with default setting. |
|
JPanelMap(JHeightMap.AbstractHeightMap map,
java.awt.Color backgroundColor)
The constructor creates graph scene with default setting with the given background color. |
|
JPanelMap(JHeightMap.AbstractHeightMap map,
int width,
int height,
boolean defaultBehavior,
java.awt.Color backgroundColor,
javax.vecmath.Point3d cameraPosition)
The constructor creates graph scene with default setting. |
|
JPanelMap(JHeightMap.AbstractHeightMap map,
int width,
int height,
java.awt.Color backgroundColor)
The constructor creates graph scene with default setting. |
Method Summary | |
---|---|
void |
addLight(JLight lightMap)
The method adds light in scene for array light. |
void |
compileScene()
Method compiles graph scene optimization rendering. |
javax.vecmath.Color3f |
getColorAmbientLight()
The method returns color default ambient light. |
javax.vecmath.Color3f |
getColorBackground()
The method returns color background in scene. |
javax.vecmath.Color3f |
getColorDirectLight()
The method returns color default direct light |
javax.vecmath.Vector3f |
getDirectionDirectLight()
The method returns direct default direct light. |
int |
getLightListSize()
The method returns size array lights. |
javax.vecmath.Point3d |
getPositionCamera()
The method returns position camera in scene. |
javax.media.j3d.TransformGroup |
getRotation()
The method returns node graph for rotation height map. |
javax.media.j3d.TransformGroup |
getScaling()
The method returns node graph for scaling height map. |
double |
getScalingNumber()
The method returns number scaling map. |
javax.media.j3d.BoundingSphere |
getSceneBounds()
The method returns value bounds. |
java.awt.Image |
getScreenImage()
The method draws scene |
javax.media.j3d.TransformGroup |
getTranslation()
The method returns node graph for translation height map. |
void |
removeLight()
The method removes last added light. |
void |
removeLight(int index)
The method removes light in scene from array Light. |
boolean |
saveImage(java.lang.String file,
java.lang.String imageType)
Saves image of a given name and type into the file |
void |
setBackClippingDistance(double d)
Sets distance of back clipping plane |
void |
setBehavior(javax.media.j3d.Behavior behavior)
The method sets new behavior and remove last behavior. |
void |
setColorAmbientLight(javax.vecmath.Color3f color)
The method sets color default ambient light |
void |
setColorBackground(javax.vecmath.Color3f color)
The method sets color background in scene. |
void |
setColorBackground(float r,
float g,
float b)
The method sets color background in scene. |
void |
setColorDirectLight(javax.vecmath.Color3f color)
The method sets color direct light. |
void |
setDirectionDirectLight(float x,
float y,
float z)
The method sets direct default direct light. |
void |
setDirectionDirectLight(javax.vecmath.Vector3f direct)
The method sets direct default direct light. |
void |
setDirectLight(javax.vecmath.Color3f color,
javax.vecmath.Vector3f direct)
The method sets direct and color default direct light. |
void |
setMap(JHeightMap.AbstractHeightMap map)
The method sets new map and inserted map into the center of the scene. |
void |
setPositionCamera(javax.vecmath.Point3d position)
The method sets position camera in scene. |
void |
setPositionCamera(javax.vecmath.Vector3f nposition)
The method sets position camera in scene. |
void |
setRotation(javax.media.j3d.TransformGroup tg)
The method sets rotation height map |
void |
setRotationX(double angle)
The method sets rotation height map about x-axis. |
void |
setRotationY(double angle)
The method sets rotation height map about y-axis. |
void |
setRotationZ(double angle)
The method sets rotation height map about z-axis. |
void |
setScaling(double scaling)
The method sets scale height map. |
void |
setScaling(javax.media.j3d.TransformGroup tg)
The method sets scaling height map. |
void |
setScaling(javax.vecmath.Vector3d scaling)
The method sets scale height map. |
void |
setTexts(java.lang.String texts)
The method sets text which draw on screen. |
void |
setTexts(java.lang.String[] texts)
The method sets text which draw on screen. |
void |
setTranslation(javax.media.j3d.TransformGroup tg)
The method sets translation height map. |
void |
setTranslation(javax.vecmath.Vector3f position)
The method sets translation height map. |
void |
setVisiableText(boolean status)
The method sets whether to display text. |
void |
update(java.awt.Graphics g)
The method draws scene. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintComponent, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printComponent, printChildren, 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 |
Methods inherited from class java.awt.Container |
---|
add, 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, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, 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, checkImage, checkImage, 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, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JPanelMap(JHeightMap.AbstractHeightMap map)
map
- Height map.public JPanelMap(JHeightMap.AbstractHeightMap map, java.awt.Color backgroundColor)
map
- Height map.backgroundColor
- color of the background (if NULL -> blue)public JPanelMap(JHeightMap.AbstractHeightMap map, int width, int height, java.awt.Color backgroundColor)
map
- Height map.width
- Width panel.height
- Height panel.backgroundColor
- color of the background (if NULL -> blue)public JPanelMap(JHeightMap.AbstractHeightMap map, int width, int height, boolean defaultBehavior, java.awt.Color backgroundColor, javax.vecmath.Point3d cameraPosition)
map
- Height map.width
- Width panelheight
- Height paneldefaultBehavior
- Value is determined whether class is using the mouse controlbackgroundColor
- color of the background (if NULL -> blue)cameraPosition
- position of the camera after creating the panelMethod Detail |
---|
public void update(java.awt.Graphics g)
update
in class javax.swing.JComponent
public java.awt.Image getScreenImage()
public void setTexts(java.lang.String[] texts)
texts
- Drawing textpublic void setTexts(java.lang.String texts)
texts
- Drawing textpublic void setVisiableText(boolean status)
status
- Value to determine text is displayed or not.public javax.media.j3d.BoundingSphere getSceneBounds()
public void setBehavior(javax.media.j3d.Behavior behavior)
behavior
- Next behavior.public void setMap(JHeightMap.AbstractHeightMap map)
map
- Height map.public void compileScene()
public void setRotation(javax.media.j3d.TransformGroup tg)
tg
- Rotation height mappublic void setTranslation(javax.vecmath.Vector3f position)
position
- Translation height map.public void setTranslation(javax.media.j3d.TransformGroup tg)
tg
- Translation height map.public void setScaling(javax.media.j3d.TransformGroup tg)
tg
- Scale height map.public javax.media.j3d.TransformGroup getRotation()
public javax.media.j3d.TransformGroup getTranslation()
public javax.media.j3d.TransformGroup getScaling()
public void setRotationX(double angle)
angle
- Angle rotation about x-axis.public void setRotationY(double angle)
angle
- Angle rotation about y-axis.public void setRotationZ(double angle)
angle
- Angle rotation about z-axis.public void setScaling(double scaling)
scaling
- Scale height map.public double getScalingNumber()
public void setScaling(javax.vecmath.Vector3d scaling)
scaling
- Vector for scale height map.public void setPositionCamera(javax.vecmath.Vector3f nposition)
nposition
- Position camera in scene.public void setPositionCamera(javax.vecmath.Point3d position)
position
- Position camera in scene.public javax.vecmath.Point3d getPositionCamera()
public void setColorBackground(javax.vecmath.Color3f color)
public void setColorBackground(float r, float g, float b)
r
- red component of set the background color in sceneg
- green component of set the background color in sceneb
- blue component of set the background color in scenépublic javax.vecmath.Color3f getColorBackground()
public void setColorAmbientLight(javax.vecmath.Color3f color)
public javax.vecmath.Color3f getColorAmbientLight()
public void setColorDirectLight(javax.vecmath.Color3f color)
color
- Color direct lightpublic void setDirectionDirectLight(javax.vecmath.Vector3f direct)
direct
- Direct direct light.public void setDirectionDirectLight(float x, float y, float z)
x
- x-coordinates directy
- y-coordinates directz
- z-coordinates directpublic void setDirectLight(javax.vecmath.Color3f color, javax.vecmath.Vector3f direct)
color
- Color direct light.direct
- Direct direct light.public void addLight(JLight lightMap)
lightMap
- Add new light.public void removeLight(int index)
index
- Index removes light.public void removeLight()
public int getLightListSize()
public javax.vecmath.Color3f getColorDirectLight()
public javax.vecmath.Vector3f getDirectionDirectLight()
public boolean saveImage(java.lang.String file, java.lang.String imageType)
file
- file nameimageType
- file type (JPG, BMP, PNG)
public void setBackClippingDistance(double d)
d
- distance of clipping plane
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |