to.tetramorph.starbase.widget
クラス AspectsPanel

java.lang.Object
  上位を拡張 java.awt.Component
      上位を拡張 java.awt.Container
          上位を拡張 javax.swing.JComponent
              上位を拡張 javax.swing.JPanel
                  上位を拡張 to.tetramorph.starbase.widget.AspectsPanel
すべての実装されたインタフェース:
ImageObserver, MenuContainer, Serializable, Accessible

public class AspectsPanel
extends JPanel

アスペクトを種類別に色設定するパネル。

関連項目:
直列化された形式

入れ子のクラスの概要
 
クラス javax.swing.JPanel から継承された入れ子のクラス/インタフェース
JPanel.AccessibleJPanel
 
クラス javax.swing.JComponent から継承された入れ子のクラス/インタフェース
JComponent.AccessibleJComponent
 
クラス java.awt.Container から継承された入れ子のクラス/インタフェース
Container.AccessibleAWTContainer
 
クラス java.awt.Component から継承された入れ子のクラス/インタフェース
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
フィールドの概要
 
クラス javax.swing.JComponent から継承されたフィールド
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
クラス java.awt.Component から継承されたフィールド
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
インタフェース java.awt.image.ImageObserver から継承されたフィールド
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
コンストラクタの概要
AspectsPanel()
          アスペクトパネルを作成する。
 
メソッドの概要
 Color getAspectBGColor()
          アスペクト円の背景色を返す。
 AspectStyle[] getAspectStyles()
          このパネルで設定されたAspectStyleの配列を返す。
 String getAspectStylesString()
          このパネルで設定されているアスペクトスタイルの情報を文字列表現で返す。
 Color getBGColor()
          背景色を返す。
 boolean isNoAspectBG()
          背景色なしのときはtrueを返す。
static void main(String[] args)
           
 void setAspectBGColor(Color color)
          アスペクト円の背景色をセット。
 void setAspectStyles(AspectStyle[] styles)
          アスペクトスタイルを配列で指定する。
 void setAspectStyles(String value)
          文字列で表現されたアスペクトスタイルの情報をこのパネルに反映させる。
 void setBGColor(Color color)
          背景色をセットする。
 void setNoAspectBG(boolean b)
          背景色無しのときはtrueを、有りのときはfalseをセットする。
 
クラス javax.swing.JPanel から継承されたメソッド
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
クラス 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, 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
 
クラス 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
 
クラス 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
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

コンストラクタの詳細

AspectsPanel

public AspectsPanel()
アスペクトパネルを作成する。

メソッドの詳細

setAspectBGColor

public void setAspectBGColor(Color color)
アスペクト円の背景色をセット。

例外:
IllegalArgumentException - 引数にnullが指定されたとき。

getAspectBGColor

public Color getAspectBGColor()
アスペクト円の背景色を返す。デフォルトは背景色と同じ。


setBGColor

public void setBGColor(Color color)
背景色をセットする。これはアスペクト円の背景色が無く透過状態のときの色。 デフォルトは白。

例外:
IllegalArgumentException - 引数にnullが指定されたとき。

getBGColor

public Color getBGColor()
背景色を返す。これはアスペクト円の背景色が無く透過状態のときの色。 デフォルトは白。


isNoAspectBG

public boolean isNoAspectBG()
背景色なしのときはtrueを返す。


setNoAspectBG

public void setNoAspectBG(boolean b)
背景色無しのときはtrueを、有りのときはfalseをセットする。


getAspectStyles

public AspectStyle[] getAspectStyles()
このパネルで設定されたAspectStyleの配列を返す。要素数25の配列で、0番目は ハイライト用のスタイル。 。[1]〜[12]はタイトアスペクトのスタイル、[13]〜[24]はルーズアスペクトの スタイル。


setAspectStyles

public void setAspectStyles(AspectStyle[] styles)
アスペクトスタイルを配列で指定する。nullの配列要素は無視する。 引数で与えられたオブジェクトのAspectIDは無視され、タイト/ルーズ、色、ストロ ーク番号が、このパネルにならんでいる順番で内部の配列にコピーされる。 つまりgetAspectStyles()が返す配列の参照は、このメソッドで与えた配列の参照 とは異なる。 [0]の要素はハイライト用で、[1]から[12]はタイトアスペクトのスタイルで、 コンジャクションからはじまり、バイクインタイルで終わる。 [13]〜[24]はルーズのスタイルで、アスペクトの順番は同じ。

例外:
IllegalArgumentException - 引数にnullを指定した場合、要素数が25では ないとき

getAspectStylesString

public String getAspectStylesString()
このパネルで設定されているアスペクトスタイルの情報を文字列表現で返す。 プロパティ保管用。setAspectStyles()で復元できる。 文字列のフォーマットは"タイト/ルーズ,ストローク番号, 色R,G,B,A"の順番でひと 組で、タイトは1ルーズは0で表される。ストローク番号は0-5まであり、AspectStyle のライン定数と同じ。色の各チャンネルは0〜255まで。

"1,5,255,0,0,240," はタイト、ストローク5番(太線)、R=255,G=0,B=0,A=240である。 このくり返しで12個のタイトアスペクト線種の定義が続き、そのあとルーズアスペクト 線種が12個続く。値はカンマで区切られ、スペース等の文字は混入してはならない。 ハイライトのスタイルからはじまり、12種類のタイトアスペクトスタイルが続き、 つづけて12種類のルーズアスペクトスタイルが続く。


setAspectStyles

public void setAspectStyles(String value)
文字列で表現されたアスペクトスタイルの情報をこのパネルに反映させる。 プロパティ保管用。getAspectStyles()の値からパネル内の設定を復元する。 getAspectStylesSting()の逆を行うわけだが、nullや""、カンマで分割したとき、 6*25=150個の要素がない文字列なら設定せず無視する。 文字列中に整数ではない文字や、異常な値が混入している場合も設定せず無視する。


main

public static void main(String[] args)