##################################################################

Appearance3DChooser v1.1

Copyright (C) 2009 Frederic Roudaut


This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

###################################################################

com.appearance3Dchooser
Class TexturePane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTabbedPane
                  extended by com.appearance3Dchooser.TexturePane
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.SwingConstants

public class TexturePane
extends javax.swing.JTabbedPane
implements java.awt.event.ActionListener, javax.swing.event.ChangeListener

Panel creation for the Textures.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
 
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  float[] blendColor
           
protected  com.colorpicker.swing.ColorPicker blendColorPicker
           
static int COMBINE_FUNCTION_ONE_MINUS_SRC_ALPHA
           
static int COMBINE_FUNCTION_ONE_MINUS_SRC_COLOR
           
static int COMBINE_FUNCTION_SRC_ALPHA
           
static int COMBINE_FUNCTION_SRC_COLOR
           
static int COMBINE_MODE_ADD
           
static int COMBINE_MODE_ADD_SIGNED
           
static int COMBINE_MODE_DOT3
           
static int COMBINE_MODE_INTERPOLATE
           
static int COMBINE_MODE_MODULATE
           
static int COMBINE_MODE_REPLACE
           
static int COMBINE_MODE_SUBTRACT
           
static int COMBINE_SOURCE_CONSTANT_COLOR
           
static int COMBINE_SOURCE_OBJECT_COLOR
           
static int COMBINE_SOURCE_PREVIOUS_TEXTURE_UNIT_STATE
           
static int COMBINE_SOURCE_TEXTURE_COLOR
           
protected  int combineAlphaFunctionC0
           
protected  int combineAlphaFunctionC1
           
protected  int combineAlphaFunctionC2
           
protected  int combineAlphaMode
           
protected  int combineAlphaScale
           
protected  int combineAlphaSourceC0
           
protected  int combineAlphaSourceC1
           
protected  int combineAlphaSourceC2
           
protected  int combineRGBFunctionC0
           
protected  int combineRGBFunctionC1
           
protected  int combineRGBFunctionC2
           
protected  int combineRGBMode
           
protected  int combineRGBScale
           
protected  int combineRGBSourceC0
           
protected  int combineRGBSourceC1
           
protected  int combineRGBSourceC2
           
protected  java.net.URL DefaultTexture
           
protected  javax.swing.JFileChooser fileChooser
           
protected  javax.swing.JButton fileChooserButton
           
protected  java.awt.Image image
           
protected  javax.swing.ImageIcon imageIcon
           
protected  javax.swing.JComboBox listCombineAlphaFunctionC0
           
protected  javax.swing.JComboBox listCombineAlphaFunctionC1
           
protected  javax.swing.JComboBox listCombineAlphaFunctionC2
           
protected  javax.swing.JComboBox listCombineAlphaMode
           
protected  javax.swing.JComboBox listCombineAlphaScale
           
protected  javax.swing.JComboBox listCombineAlphaSourceC0
           
protected  javax.swing.JComboBox listCombineAlphaSourceC1
           
protected  javax.swing.JComboBox listCombineAlphaSourceC2
           
protected  javax.swing.JComboBox listCombineRGBFunctionC0
           
protected  javax.swing.JComboBox listCombineRGBFunctionC1
           
protected  javax.swing.JComboBox listCombineRGBFunctionC2
           
protected  javax.swing.JComboBox listCombineRGBMode
           
protected  javax.swing.JComboBox listCombineRGBScale
           
protected  javax.swing.JComboBox listCombineRGBSourceC0
           
protected  javax.swing.JComboBox listCombineRGBSourceC1
           
protected  javax.swing.JComboBox listCombineRGBSourceC2
           
protected  javax.swing.JComboBox listPerspectiveCorrectionMode
           
protected  javax.swing.JComboBox listTextureMode
           
protected  javax.swing.JButton OKButton
           
static int PERSPECTIVE_CORRECTION_MODE_FASTEST
           
static int PERSPECTIVE_CORRECTION_MODE_NICEST
           
protected  int perspectiveCorrectionMode
           
private static long serialVersionUID
           
protected  javax.swing.JRadioButton setTextureButton
           
static java.lang.String TEXTURE_BLEND
           
static java.lang.String TEXTURE_COMBINE_ALPHA_FUNCTION
           
static java.lang.String TEXTURE_COMBINE_ALPHA_MODE
           
static java.lang.String TEXTURE_COMBINE_ALPHA_SCALE
           
static java.lang.String TEXTURE_COMBINE_ALPHA_SOURCE
           
static java.lang.String TEXTURE_COMBINE_RGB_FUNCTION
           
static java.lang.String TEXTURE_COMBINE_RGB_MODE
           
static java.lang.String TEXTURE_COMBINE_RGB_SCALE
           
static java.lang.String TEXTURE_COMBINE_RGB_SOURCE
           
static java.lang.String TEXTURE_FILE
           
static java.lang.String TEXTURE_MODE
           
static int TEXTURE_MODE_BLEND
           
static int TEXTURE_MODE_COMBINE
           
static int TEXTURE_MODE_DECAL
           
static int TEXTURE_MODE_MODULATE
           
static int TEXTURE_MODE_REPLACE
           
static java.lang.String TEXTURE_PERPSPECTIVE_CORRECTION_MODE
           
static java.lang.String TEXTURE_TRANSFORM
           
static java.lang.String TEXTURE_USE
           
protected  javax.swing.JRadioButton textureButtonTransformReset
           
protected  javax.swing.JRadioButton textureButtonTransformUniformScale
           
protected  int textureMode
           
protected  java.net.URL textureName
           
protected  javax.swing.JTextField textureNameJText
           
protected  javax.swing.JSpinner textureSpinnerTransformRotZ
           
protected  javax.swing.JSpinner textureSpinnerTransformScaleX
           
protected  javax.swing.JSpinner textureSpinnerTransformScaleY
           
protected  javax.swing.JSpinner textureSpinnerTransformTranslatX
           
protected  javax.swing.JSpinner textureSpinnerTransformTranslatY
           
protected  javax.swing.JTabbedPane textureTabbedPane
           
protected  javax.media.j3d.Transform3D textureTransform
           
protected  boolean textureTransformUniformScale
           
protected  boolean useTexture
           
 
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TexturePane(java.net.URL DefaultTextureName)
          Constructor for creating a Texture panel
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called when an action is performed : the OK button is clicked, the Texture is set or changed, the Texture Mode or the Texture Perspective correction Mode is modified ...
static int convertExternPerspectiveCorrectionMode(int m)
          Convert a Texture Perspective Correction Mode om Internal representation to TextureAttributes representation.
static int convertExternTextureCombineFunction(int m)
          Convert a Texture Combine RGB/Alpha Color Function om Internal representation to TextureAttributes representation.
static int convertExternTextureCombineMode(int m)
          Convert a Texture Combine RGB/Alpha Mode om Internal representation to TextureAttributes representation.
static int convertExternTextureCombineScale(int m)
          Convert a Texture Combine Scale Factor from Internal representation to TextureAttributes representation.
static int convertExternTextureCombineSource(int m)
          Convert a Texture Combine RGB/Alpha Color Source om Internal representation to TextureAttributes representation.
static int convertExternTextureMode(int m)
          Convert a Texture Mode om Internal representation to TextureAttributes representation.
static int convertInternPerspectiveCorrectionMode(int m)
          Convert a Texture Perspective Correction Mode om TextureAttributes representation to Internal representation.
static int convertInternTextureCombineFunction(int m)
          Convert a Texture Combine RGB/Alpha Color Function om TextureAttributes representation to Internal representation.
static int convertInternTextureCombineMode(int m)
          Convert a Texture Combine RGB/Alpha Mode om TextureAttributes representation to Internal representation.
static int convertInternTextureCombineScale(int m)
          Convert a Texture Combine Scale Factor om TextureAttributes representation to Internal representation.
static int convertInternTextureCombineSource(int m)
          Convert a Texture Combine RGB/Alpha Color Source om TextureAttributes representation to Internal representation.
static int convertInternTextureMode(int m)
          Convert a Texture Mode om TextureAttributes representation to Internal representation.
 javax.swing.JPanel createImagePanel()
          Panel creation for the texture image.
 float[] getTextureBlendColor()
          Get the current Texture blend color.
 int[] getTextureCombineAlphaFunction()
          Get the current Texture Combine Alpha Function.
 int getTextureCombineAlphaMode()
          Get the current Texture Combine Alpha Mode.
 int getTextureCombineAlphaScale()
          Get the current Texture Combine Alpha Scale Factor.
 int[] getTextureCombineAlphaSource()
          Get the current Texture Combine Alpha Source.
 int[] getTextureCombineRGBFunction()
          Get the current Texture Combine RGB Function.
 int getTextureCombineRGBMode()
          Get the current Texture Combine RGB Mode.
 int getTextureCombineRGBScale()
          Get the current Texture Combine RGB Scale Factor.
 int[] getTextureCombineRGBSource()
          Get the current Texture Combine RGB Source.
 java.net.URL getTextureFile()
          Give the current Texture file.
 int getTextureMode()
          Get the current Texture Mode.
 int getTexturePerspectiveCorrectionMode()
          Get the current Texture Perspective Correction Mode.
 javax.media.j3d.Transform3D getTextureTransform()
          Get the current Texture transformation.
 float getTextureTransformRotZ()
          Get the current Texture rotation transformation on the Z axis.
 float getTextureTransformScaleX()
          Get the current Texture scale transformation on the X axis.
 float getTextureTransformScaleY()
          Get the current Texture scale transformation on the Y axis.
 float getTextureTransformTranslatX()
          Get the current Texture translation transformation on the X axis.
 float getTextureTransformTranslatY()
          Get the current Texture translation transformation on the Y axis.
 boolean isTextureSet()
          Check is the Texture is used.
private  void makeBasicTexturePane()
          Basic parameters Panel for the Texture : use, don't use, Texture tranformation, Texture Mode, Texture Perspective Correction Mode.
private  void makeBlendColorPane()
          Blend Color Panel for the Texture.
private  void makeCombineModePane()
          COMBINE parameters Panel for the Texture.
 void setDefaultTextureFile(java.net.URL f)
          Set the current default Texture file.
 void setTextureBlendColor(float[] c)
          Set the Texture blend color.
 void setTextureCombineAlphaFunction(int[] c)
          Set the Texture Combine Alpha Function.
 void setTextureCombineAlphaMode(int m)
          Set the Texture Combine Alpha Mode.
 void setTextureCombineAlphaScale(int m)
          Set the Texture Combine Alpha Scale Factor.
 void setTextureCombineAlphaSource(int[] c)
          Set the Texture Combine Alpha Source.
 void setTextureCombineRGBFunction(int[] c)
          Set the Texture Combine RGB Function.
 void setTextureCombineRGBMode(int m)
          Set the Texture Combine RGB Mode.
 void setTextureCombineRGBScale(int m)
          Set the Texture Combine RGB Scale Factor.
 void setTextureCombineRGBSource(int[] c)
          Set the Texture Combine RGB Source.
 void setTextureFile(java.net.URL f)
          Set the current Texture file.
 void setTextureMode(int m)
          Set the Texture Mode.
 void setTexturePerspectiveCorrectionMode(int m)
          Set the Texture Perspective Correction Mode.
 void setTextureTransform(javax.media.j3d.Transform3D t)
          Set the Texture transformation.
 void setTextureTransformRotZ(float v)
          Set the Texture rotation transformation on the Z axis.
 void setTextureTransformScaleX(float v)
          Set the Texture scale transformation on the X axis.
 void setTextureTransformScaleY(float v)
          Set the Texture scale transformation on the Y axis.
 void setTextureTransformTranslatX(float v)
          Set the Texture translation transformation on the X axis.
 void setTextureTransformTranslatY(float v)
          Set the Texture translation transformation on the Y axis.
 void setTextureUse(boolean b)
          use or not the current Texture.
 void stateChanged(javax.swing.event.ChangeEvent e)
          Called when a modification is done on the Texture transformation.
 void updateImage(java.net.URL texture)
          Update the texture image shown and the Texture itself.
private  void updateTextureBlendColor(float[] b)
          Update the Texture blend color.
 
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabComponentAt, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, indexOfTabComponent, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabComponentAt, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, update
 
Methods inherited from class java.awt.Container
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, 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, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

TEXTURE_FILE

public static final java.lang.String TEXTURE_FILE
See Also:
Constant Field Values

TEXTURE_USE

public static final java.lang.String TEXTURE_USE
See Also:
Constant Field Values

TEXTURE_TRANSFORM

public static final java.lang.String TEXTURE_TRANSFORM
See Also:
Constant Field Values

TEXTURE_PERPSPECTIVE_CORRECTION_MODE

public static final java.lang.String TEXTURE_PERPSPECTIVE_CORRECTION_MODE
See Also:
Constant Field Values

TEXTURE_MODE

public static final java.lang.String TEXTURE_MODE
See Also:
Constant Field Values

TEXTURE_BLEND

public static final java.lang.String TEXTURE_BLEND
See Also:
Constant Field Values

TEXTURE_COMBINE_RGB_MODE

public static final java.lang.String TEXTURE_COMBINE_RGB_MODE
See Also:
Constant Field Values

TEXTURE_COMBINE_RGB_SOURCE

public static final java.lang.String TEXTURE_COMBINE_RGB_SOURCE
See Also:
Constant Field Values

TEXTURE_COMBINE_RGB_FUNCTION

public static final java.lang.String TEXTURE_COMBINE_RGB_FUNCTION
See Also:
Constant Field Values

TEXTURE_COMBINE_RGB_SCALE

public static final java.lang.String TEXTURE_COMBINE_RGB_SCALE
See Also:
Constant Field Values

TEXTURE_COMBINE_ALPHA_MODE

public static final java.lang.String TEXTURE_COMBINE_ALPHA_MODE
See Also:
Constant Field Values

TEXTURE_COMBINE_ALPHA_SOURCE

public static final java.lang.String TEXTURE_COMBINE_ALPHA_SOURCE
See Also:
Constant Field Values

TEXTURE_COMBINE_ALPHA_FUNCTION

public static final java.lang.String TEXTURE_COMBINE_ALPHA_FUNCTION
See Also:
Constant Field Values

TEXTURE_COMBINE_ALPHA_SCALE

public static final java.lang.String TEXTURE_COMBINE_ALPHA_SCALE
See Also:
Constant Field Values

TEXTURE_MODE_MODULATE

public static final int TEXTURE_MODE_MODULATE
See Also:
Constant Field Values

TEXTURE_MODE_DECAL

public static final int TEXTURE_MODE_DECAL
See Also:
Constant Field Values

TEXTURE_MODE_BLEND

public static final int TEXTURE_MODE_BLEND
See Also:
Constant Field Values

TEXTURE_MODE_REPLACE

public static final int TEXTURE_MODE_REPLACE
See Also:
Constant Field Values

TEXTURE_MODE_COMBINE

public static final int TEXTURE_MODE_COMBINE
See Also:
Constant Field Values

COMBINE_MODE_REPLACE

public static final int COMBINE_MODE_REPLACE
See Also:
Constant Field Values

COMBINE_MODE_MODULATE

public static final int COMBINE_MODE_MODULATE
See Also:
Constant Field Values

COMBINE_MODE_ADD

public static final int COMBINE_MODE_ADD
See Also:
Constant Field Values

COMBINE_MODE_ADD_SIGNED

public static final int COMBINE_MODE_ADD_SIGNED
See Also:
Constant Field Values

COMBINE_MODE_SUBTRACT

public static final int COMBINE_MODE_SUBTRACT
See Also:
Constant Field Values

COMBINE_MODE_INTERPOLATE

public static final int COMBINE_MODE_INTERPOLATE
See Also:
Constant Field Values

COMBINE_MODE_DOT3

public static final int COMBINE_MODE_DOT3
See Also:
Constant Field Values

COMBINE_FUNCTION_SRC_ALPHA

public static final int COMBINE_FUNCTION_SRC_ALPHA
See Also:
Constant Field Values

COMBINE_FUNCTION_ONE_MINUS_SRC_ALPHA

public static final int COMBINE_FUNCTION_ONE_MINUS_SRC_ALPHA
See Also:
Constant Field Values

COMBINE_FUNCTION_SRC_COLOR

public static final int COMBINE_FUNCTION_SRC_COLOR
See Also:
Constant Field Values

COMBINE_FUNCTION_ONE_MINUS_SRC_COLOR

public static final int COMBINE_FUNCTION_ONE_MINUS_SRC_COLOR
See Also:
Constant Field Values

COMBINE_SOURCE_OBJECT_COLOR

public static final int COMBINE_SOURCE_OBJECT_COLOR
See Also:
Constant Field Values

COMBINE_SOURCE_TEXTURE_COLOR

public static final int COMBINE_SOURCE_TEXTURE_COLOR
See Also:
Constant Field Values

COMBINE_SOURCE_CONSTANT_COLOR

public static final int COMBINE_SOURCE_CONSTANT_COLOR
See Also:
Constant Field Values

COMBINE_SOURCE_PREVIOUS_TEXTURE_UNIT_STATE

public static final int COMBINE_SOURCE_PREVIOUS_TEXTURE_UNIT_STATE
See Also:
Constant Field Values

PERSPECTIVE_CORRECTION_MODE_FASTEST

public static final int PERSPECTIVE_CORRECTION_MODE_FASTEST
See Also:
Constant Field Values

PERSPECTIVE_CORRECTION_MODE_NICEST

public static final int PERSPECTIVE_CORRECTION_MODE_NICEST
See Also:
Constant Field Values

textureNameJText

protected javax.swing.JTextField textureNameJText

fileChooserButton

protected javax.swing.JButton fileChooserButton

OKButton

protected javax.swing.JButton OKButton

fileChooser

protected javax.swing.JFileChooser fileChooser

setTextureButton

protected javax.swing.JRadioButton setTextureButton

imageIcon

protected javax.swing.ImageIcon imageIcon

textureName

protected java.net.URL textureName

DefaultTexture

protected java.net.URL DefaultTexture

useTexture

protected boolean useTexture

image

protected java.awt.Image image

textureMode

protected int textureMode

perspectiveCorrectionMode

protected int perspectiveCorrectionMode

combineRGBMode

protected int combineRGBMode

combineAlphaMode

protected int combineAlphaMode

combineRGBFunctionC0

protected int combineRGBFunctionC0

combineRGBFunctionC1

protected int combineRGBFunctionC1

combineRGBFunctionC2

protected int combineRGBFunctionC2

combineAlphaFunctionC0

protected int combineAlphaFunctionC0

combineAlphaFunctionC1

protected int combineAlphaFunctionC1

combineAlphaFunctionC2

protected int combineAlphaFunctionC2

combineRGBSourceC0

protected int combineRGBSourceC0

combineRGBSourceC1

protected int combineRGBSourceC1

combineRGBSourceC2

protected int combineRGBSourceC2

combineAlphaSourceC0

protected int combineAlphaSourceC0

combineAlphaSourceC1

protected int combineAlphaSourceC1

combineAlphaSourceC2

protected int combineAlphaSourceC2

combineRGBScale

protected int combineRGBScale

combineAlphaScale

protected int combineAlphaScale

textureTransform

protected javax.media.j3d.Transform3D textureTransform

textureTransformUniformScale

protected boolean textureTransformUniformScale

blendColor

protected float[] blendColor

listTextureMode

protected javax.swing.JComboBox listTextureMode

listCombineRGBMode

protected javax.swing.JComboBox listCombineRGBMode

listCombineAlphaMode

protected javax.swing.JComboBox listCombineAlphaMode

listCombineRGBFunctionC0

protected javax.swing.JComboBox listCombineRGBFunctionC0

listCombineRGBFunctionC1

protected javax.swing.JComboBox listCombineRGBFunctionC1

listCombineRGBFunctionC2

protected javax.swing.JComboBox listCombineRGBFunctionC2

listCombineAlphaFunctionC0

protected javax.swing.JComboBox listCombineAlphaFunctionC0

listCombineAlphaFunctionC1

protected javax.swing.JComboBox listCombineAlphaFunctionC1

listCombineAlphaFunctionC2

protected javax.swing.JComboBox listCombineAlphaFunctionC2

listCombineRGBSourceC0

protected javax.swing.JComboBox listCombineRGBSourceC0

listCombineRGBSourceC1

protected javax.swing.JComboBox listCombineRGBSourceC1

listCombineRGBSourceC2

protected javax.swing.JComboBox listCombineRGBSourceC2

listCombineAlphaSourceC0

protected javax.swing.JComboBox listCombineAlphaSourceC0

listCombineAlphaSourceC1

protected javax.swing.JComboBox listCombineAlphaSourceC1

listCombineAlphaSourceC2

protected javax.swing.JComboBox listCombineAlphaSourceC2

listPerspectiveCorrectionMode

protected javax.swing.JComboBox listPerspectiveCorrectionMode

listCombineRGBScale

protected javax.swing.JComboBox listCombineRGBScale

listCombineAlphaScale

protected javax.swing.JComboBox listCombineAlphaScale

textureSpinnerTransformRotZ

protected javax.swing.JSpinner textureSpinnerTransformRotZ

textureSpinnerTransformScaleX

protected javax.swing.JSpinner textureSpinnerTransformScaleX

textureSpinnerTransformScaleY

protected javax.swing.JSpinner textureSpinnerTransformScaleY

textureSpinnerTransformTranslatX

protected javax.swing.JSpinner textureSpinnerTransformTranslatX

textureSpinnerTransformTranslatY

protected javax.swing.JSpinner textureSpinnerTransformTranslatY

textureButtonTransformReset

protected javax.swing.JRadioButton textureButtonTransformReset

textureButtonTransformUniformScale

protected javax.swing.JRadioButton textureButtonTransformUniformScale

textureTabbedPane

protected javax.swing.JTabbedPane textureTabbedPane

blendColorPicker

protected com.colorpicker.swing.ColorPicker blendColorPicker
Constructor Detail

TexturePane

public TexturePane(java.net.URL DefaultTextureName)
Constructor for creating a Texture panel

Parameters:
DefaultTextureName - Default Texture URL.
Method Detail

makeBasicTexturePane

private void makeBasicTexturePane()
Basic parameters Panel for the Texture : use, don't use, Texture tranformation, Texture Mode, Texture Perspective Correction Mode.


makeCombineModePane

private void makeCombineModePane()
COMBINE parameters Panel for the Texture.


makeBlendColorPane

private void makeBlendColorPane()
Blend Color Panel for the Texture.


createImagePanel

public javax.swing.JPanel createImagePanel()
Panel creation for the texture image. A default image is used and shown here.

Returns:
the Panel created.

updateImage

public void updateImage(java.net.URL texture)
Update the texture image shown and the Texture itself.

Parameters:
texture - the new Texture File.

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
Called when a modification is done on the Texture transformation.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
e - the related event.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called when an action is performed : the OK button is clicked, the Texture is set or changed, the Texture Mode or the Texture Perspective correction Mode is modified ...

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the related action.

getTextureFile

public java.net.URL getTextureFile()
Give the current Texture file.

Returns:
the Texture file.

setTextureFile

public void setTextureFile(java.net.URL f)
Set the current Texture file.

Parameters:
f - the Texture file to set.

setDefaultTextureFile

public void setDefaultTextureFile(java.net.URL f)
Set the current default Texture file.

Parameters:
f - the Texture default file to set.

isTextureSet

public boolean isTextureSet()
Check is the Texture is used.

Returns:
true if the Texture is used, false otherwise.

setTextureUse

public void setTextureUse(boolean b)
use or not the current Texture.

Parameters:
b - true if the currect Texture has to be used, false otherwise.

getTextureTransform

public javax.media.j3d.Transform3D getTextureTransform()
Get the current Texture transformation.

Returns:
the current Texture transformation.

setTextureTransform

public void setTextureTransform(javax.media.j3d.Transform3D t)
Set the Texture transformation.

Parameters:
t - the Texture transformation to use.

getTextureTransformScaleX

public float getTextureTransformScaleX()
Get the current Texture scale transformation on the X axis.

Returns:
the current Texture scale transformation on the X axis.

setTextureTransformScaleX

public void setTextureTransformScaleX(float v)
Set the Texture scale transformation on the X axis.

Parameters:
v - the Texture scale transformation on the X axis to use.

getTextureTransformScaleY

public float getTextureTransformScaleY()
Get the current Texture scale transformation on the Y axis.

Returns:
the current Texture scale transformation on the Y axis.

setTextureTransformScaleY

public void setTextureTransformScaleY(float v)
Set the Texture scale transformation on the Y axis.

Parameters:
v - the Texture scale transformation on the Y axis to use.

getTextureTransformTranslatX

public float getTextureTransformTranslatX()
Get the current Texture translation transformation on the X axis.

Returns:
the current Texture translation transformation on the X axis.

setTextureTransformTranslatX

public void setTextureTransformTranslatX(float v)
Set the Texture translation transformation on the X axis.

Parameters:
v - the Texture translation transformation on the X axis to use.

getTextureTransformTranslatY

public float getTextureTransformTranslatY()
Get the current Texture translation transformation on the Y axis.

Returns:
the current Texture translation transformation on the Y axis.

setTextureTransformTranslatY

public void setTextureTransformTranslatY(float v)
Set the Texture translation transformation on the Y axis.

Parameters:
v - the Texture translation transformation on the Y axis to use.

getTextureTransformRotZ

public float getTextureTransformRotZ()
Get the current Texture rotation transformation on the Z axis.

Returns:
the current Texture rotation transformation on the Z axis.

setTextureTransformRotZ

public void setTextureTransformRotZ(float v)
Set the Texture rotation transformation on the Z axis.

Parameters:
v - the Texture rotation transformation on the Z axis to use.

getTextureMode

public int getTextureMode()
Get the current Texture Mode.

Returns:
the current Texture Mode.

setTextureMode

public void setTextureMode(int m)
Set the Texture Mode.

Parameters:
m - the Texture Mode to use.

getTexturePerspectiveCorrectionMode

public int getTexturePerspectiveCorrectionMode()
Get the current Texture Perspective Correction Mode.

Returns:
the current Texture Perspective Correction Mode.

setTexturePerspectiveCorrectionMode

public void setTexturePerspectiveCorrectionMode(int m)
Set the Texture Perspective Correction Mode.

Parameters:
m - the Texture Perspective Correction Mode to use.

getTextureBlendColor

public float[] getTextureBlendColor()
Get the current Texture blend color.

Returns:
the current Texture blend color.

setTextureBlendColor

public void setTextureBlendColor(float[] c)
Set the Texture blend color.

Parameters:
c - the Texture blend color to use.

getTextureCombineRGBMode

public int getTextureCombineRGBMode()
Get the current Texture Combine RGB Mode.

Returns:
the current Texture Combine RGB Mode.

setTextureCombineRGBMode

public void setTextureCombineRGBMode(int m)
Set the Texture Combine RGB Mode.

Parameters:
m - the Texture Combine RGB Mode to use.

getTextureCombineRGBSource

public int[] getTextureCombineRGBSource()
Get the current Texture Combine RGB Source.

Returns:
the current Texture Combine RGB Source (C0,C1,C2).

setTextureCombineRGBSource

public void setTextureCombineRGBSource(int[] c)
Set the Texture Combine RGB Source.

Parameters:
c - the Texture Combine RGB Source Mode (C0,C1,C2) to use.

getTextureCombineRGBFunction

public int[] getTextureCombineRGBFunction()
Get the current Texture Combine RGB Function.

Returns:
the current Texture Combine RGB Function (C0,C1,C2).

setTextureCombineRGBFunction

public void setTextureCombineRGBFunction(int[] c)
Set the Texture Combine RGB Function.

Parameters:
c - the Texture Combine RGB Function Mode (C0,C1,C2) to use.

getTextureCombineRGBScale

public int getTextureCombineRGBScale()
Get the current Texture Combine RGB Scale Factor.

Returns:
the current Texture Combine RGB Scale Factor.

setTextureCombineRGBScale

public void setTextureCombineRGBScale(int m)
Set the Texture Combine RGB Scale Factor.

Parameters:
m - the Texture Combine RGB Scale Factor to use.

getTextureCombineAlphaMode

public int getTextureCombineAlphaMode()
Get the current Texture Combine Alpha Mode.

Returns:
the current Texture Combine Alpha Mode.

setTextureCombineAlphaMode

public void setTextureCombineAlphaMode(int m)
Set the Texture Combine Alpha Mode.

Parameters:
m - the Texture Combine Alpha Mode to use.

getTextureCombineAlphaSource

public int[] getTextureCombineAlphaSource()
Get the current Texture Combine Alpha Source.

Returns:
the current Texture Combine Alpha Source (C0,C1,C2).

setTextureCombineAlphaSource

public void setTextureCombineAlphaSource(int[] c)
Set the Texture Combine Alpha Source.

Parameters:
c - the Texture Combine Alpha Source Mode (C0,C1,C2) to use.

getTextureCombineAlphaFunction

public int[] getTextureCombineAlphaFunction()
Get the current Texture Combine Alpha Function.

Returns:
the current Texture Combine Alpha Function (C0,C1,C2).

setTextureCombineAlphaFunction

public void setTextureCombineAlphaFunction(int[] c)
Set the Texture Combine Alpha Function.

Parameters:
c - the Texture Combine Alpha Function Mode (C0,C1,C2) to use.

getTextureCombineAlphaScale

public int getTextureCombineAlphaScale()
Get the current Texture Combine Alpha Scale Factor.

Returns:
the current Texture Combine Alpha Scale Factor.

setTextureCombineAlphaScale

public void setTextureCombineAlphaScale(int m)
Set the Texture Combine Alpha Scale Factor.

Parameters:
m - the Texture Combine Alpha Scale Factor to use.

updateTextureBlendColor

private void updateTextureBlendColor(float[] b)
Update the Texture blend color. Called when a blend color parameter is modified.

Parameters:
b - the (R,G,B,A) value of the new Texture blend color to use.

convertInternPerspectiveCorrectionMode

public static int convertInternPerspectiveCorrectionMode(int m)
Convert a Texture Perspective Correction Mode om TextureAttributes representation to Internal representation.

Parameters:
m - a Texture Perspective Correction Mode in TextureAttributes representation.
Returns:
a Texture Perspective Correction Mode in Internal representation.

convertExternPerspectiveCorrectionMode

public static int convertExternPerspectiveCorrectionMode(int m)
Convert a Texture Perspective Correction Mode om Internal representation to TextureAttributes representation.

Parameters:
m - a Texture Perspective Correction Mode in Internal representation.
Returns:
a Texture Perspective Correction Mode in TextureAttributes representation.

convertInternTextureMode

public static int convertInternTextureMode(int m)
Convert a Texture Mode om TextureAttributes representation to Internal representation.

Parameters:
m - a Texture Mode in TextureAttributes representation.
Returns:
a Texture Mode in Internal representation.

convertExternTextureMode

public static int convertExternTextureMode(int m)
Convert a Texture Mode om Internal representation to TextureAttributes representation.

Parameters:
m - a Texture Mode in Internal representation.
Returns:
a Texture Mode in TextureAttributes representation.

convertInternTextureCombineMode

public static int convertInternTextureCombineMode(int m)
Convert a Texture Combine RGB/Alpha Mode om TextureAttributes representation to Internal representation.

Parameters:
m - a Texture Combine RGB/Alpha Mode in TextureAttributes representation.
Returns:
a Texture Combine RGB/Alpha Mode in Internal representation.

convertExternTextureCombineMode

public static int convertExternTextureCombineMode(int m)
Convert a Texture Combine RGB/Alpha Mode om Internal representation to TextureAttributes representation.

Parameters:
m - a Texture Combine RGB/Alpha Mode in Internal representation.
Returns:
a Texture Combine RGB/Alpha Mode in TextureAttributes representation.

convertInternTextureCombineSource

public static int convertInternTextureCombineSource(int m)
Convert a Texture Combine RGB/Alpha Color Source om TextureAttributes representation to Internal representation.

Parameters:
m - a Texture Combine RGB/Alpha Color Source in TextureAttributes representation.
Returns:
a Texture Combine RGB/Alpha Color Source in Internal representation.

convertExternTextureCombineSource

public static int convertExternTextureCombineSource(int m)
Convert a Texture Combine RGB/Alpha Color Source om Internal representation to TextureAttributes representation.

Parameters:
m - a Texture Combine RGB/Alpha Color Source in Internal representation.
Returns:
a Texture Combine RGB/Alpha Color Source in TextureAttributes representation.

convertInternTextureCombineFunction

public static int convertInternTextureCombineFunction(int m)
Convert a Texture Combine RGB/Alpha Color Function om TextureAttributes representation to Internal representation.

Parameters:
m - a Texture Combine RGB/Alpha Color Function in TextureAttributes representation.
Returns:
a Texture Combine RGB/Alpha Color Function in Internal representation.

convertExternTextureCombineFunction

public static int convertExternTextureCombineFunction(int m)
Convert a Texture Combine RGB/Alpha Color Function om Internal representation to TextureAttributes representation.

Parameters:
m - a Texture Combine RGB/Alpha Color Function in Internal representation.
Returns:
a Texture Combine RGB/Alpha Color Function in TextureAttributes representation.

convertInternTextureCombineScale

public static int convertInternTextureCombineScale(int m)
Convert a Texture Combine Scale Factor om TextureAttributes representation to Internal representation.

Parameters:
m - a Texture Combine Scale Factor in TextureAttributes representation.
Returns:
a Texture Combine Scale Factor in Internal representation.

convertExternTextureCombineScale

public static int convertExternTextureCombineScale(int m)
Convert a Texture Combine Scale Factor from Internal representation to TextureAttributes representation.

Parameters:
m - a Texture Combine Scale Factor in Internal representation.
Returns:
a Texture Combine Scale Factor in TextureAttributes representation.


##################################################################

Appearance3DChooser v1.1

Copyright (C) 2009 Frederic Roudaut


This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

###################################################################