|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.text.JTextComponent | +--javax.swing.JEditorPane | +--javax.swing.JTextPane | +--SpreadSheetApplet.Cell
Classe Cell implémentant une cellule d'un tableur (SpreadSheet).
Inner Class Summary | |
private class |
Cell.TextChangedListener
Classe interne permettant de gèrer l'introduction de formules. |
Field Summary | |
private java.lang.String |
formula
|
private int |
inSubTables
|
private int |
minHeight
|
private java.awt.Point |
position
|
private java.awt.Point |
size
|
private SpreadSheetApplet.SpreadSheet |
spreadSheet
|
private java.util.Vector |
subTables
|
private java.util.Iterator |
tableIter
|
private int |
type
|
Fields inherited from class javax.swing.JTextPane |
uiClassID |
Fields inherited from class javax.swing.JEditorPane |
kit,
kitLoaderRegistryKey,
kitRegistryKey,
kitTypeRegistryKey,
loading,
pageProperties,
typeHandlers,
uiClassID |
Fields inherited from class javax.swing.text.JTextComponent |
caret,
caretColor,
caretEvent,
checkedInputOverride,
composedText,
composedTextCaret,
composedTextContent,
composedTextEnd,
composedTextStart,
DEFAULT_KEYMAP,
defaultTransferHandler,
disabledTextColor,
dragEnabled,
editable,
editor,
FOCUS_ACCELERATOR_KEY,
focusAccelerator,
focusedComponent,
highlighter,
inputMethodRequestsHandler,
keymap,
keymapTable,
latestCommittedTextEnd,
latestCommittedTextStart,
margin,
model,
navigationFilter,
needToSendKeyTypedEvent,
originalCaret,
overrideMap,
selectedTextColor,
selectionColor |
Fields inherited from class javax.swing.JComponent |
_bounds,
accessibleContext,
actionMap,
ACTIONMAP_CREATED,
alignmentX,
alignmentY,
ANCESTOR_INPUTMAP_CREATED,
ANCESTOR_USING_BUFFER,
ancestorInputMap,
ancestorNotifier,
autoscroller,
border,
changeSupport,
checkedSuppressDropSupport,
clientProperties,
COMPLETELY_OBSCURED,
CREATED_DOUBLE_BUFFER,
CREATED_VOLATILE_DOUBLE_BUFFER,
defaultLocale,
flags,
FOCUS_INPUTMAP_CREATED,
focusInputMap,
htmlKey,
htmlView,
inputVerifier,
IS_DOUBLE_BUFFERED,
IS_OPAQUE,
IS_PAINTING_TILE,
IS_PRINTING,
IS_PRINTING_ALL,
IS_REPAINTING,
KEY_EVENTS_ENABLED,
KEYBOARD_BINDINGS_KEY,
listenerList,
managingFocusBackwardTraversalKeys,
managingFocusForwardTraversalKeys,
maximumSize,
minimumSize,
NEXT_FOCUS,
NOT_OBSCURED,
paintImmediatelyClip,
paintingChild,
PARTIALLY_OBSCURED,
preferredSize,
readObjectCallbacks,
REQUEST_FOCUS_DISABLED,
RESERVED_1,
RESERVED_2,
RESERVED_3,
RESERVED_4,
RESERVED_5,
RESERVED_6,
suppressDropSupport,
tmpRect,
TOOL_TIP_TEXT_KEY,
transfer,
ui,
uiClassID,
UNDEFINED_CONDITION,
verifyInputWhenFocusTarget,
vetoableChangeSupport,
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
WHEN_FOCUSED,
WHEN_IN_FOCUSED_WINDOW,
WHEN_IN_FOCUSED_WINDOW_BINDINGS,
WIF_INPUTMAP_CREATED,
windowInputMap,
WRITE_OBJ_COUNTER_FIRST,
WRITE_OBJ_COUNTER_LAST |
Fields inherited from class java.awt.Container |
component,
containerListener,
containerSerializedDataVersion,
dbg,
descendantsCount,
dispatcher,
focusCycleRoot,
focusTraversalPolicy,
INCLUDE_SELF,
layoutMgr,
listeningBoundsChildren,
listeningChildren,
maxSize,
ncomponents,
printing,
printingThreads,
SEARCH_HEAVYWEIGHTS,
serialVersionUID |
Fields inherited from class java.awt.Component |
accessibleContext,
actionListenerK,
adjustmentListenerK,
appContext,
background,
BOTTOM_ALIGNMENT,
bufferStrategy,
CENTER_ALIGNMENT,
changeSupport,
componentListener,
componentListenerK,
componentOrientation,
componentSerializedDataVersion,
containerListenerK,
cursor,
dbg,
dropTarget,
enabled,
eventMask,
FOCUS_TRAVERSABLE_DEFAULT,
FOCUS_TRAVERSABLE_SET,
FOCUS_TRAVERSABLE_UNKNOWN,
focusable,
focusListener,
focusListenerK,
focusTraversalKeyPropertyNames,
focusTraversalKeys,
focusTraversalKeysEnabled,
font,
foreground,
graphicsConfig,
height,
hierarchyBoundsListener,
hierarchyBoundsListenerK,
hierarchyListener,
hierarchyListenerK,
ignoreRepaint,
incRate,
inputMethodListener,
inputMethodListenerK,
isFocusTraversableOverridden,
isInc,
isPacked,
itemListenerK,
keyListener,
keyListenerK,
LEFT_ALIGNMENT,
locale,
LOCK,
metrics,
minSize,
mouseListener,
mouseListenerK,
mouseMotionListener,
mouseMotionListenerK,
mouseWheelListener,
mouseWheelListenerK,
name,
nameExplicitlySet,
newEventsOnly,
ownedWindowK,
parent,
peer,
peerFont,
popups,
prefSize,
privateKey,
RIGHT_ALIGNMENT,
serialVersionUID,
textListenerK,
TOP_ALIGNMENT,
valid,
visible,
width,
windowClosingException,
windowFocusListenerK,
windowListenerK,
windowStateListenerK,
x,
y |
Constructor Summary | |
Cell(java.awt.Point p)
Constructeur créant une cellule vide. |
|
Cell(java.awt.Point p,
java.awt.event.MouseListener m,
javax.swing.event.UndoableEditListener u,
SpreadSheetApplet.SpreadSheet sp)
Constructeur identique au précédent mais pour une cellule de taille (1,1). |
|
Cell(java.awt.Point p,
java.awt.Point s,
java.awt.event.MouseListener m,
javax.swing.event.UndoableEditListener u,
SpreadSheetApplet.SpreadSheet sp)
Constructeur général. |
Method Summary | |
private boolean |
arrayContains(java.lang.Object[] arr,
java.lang.Object o)
Vérifie si un objet o se trouve dans un tableau d'objet arr. |
void |
fromHTML(java.lang.String html)
|
java.awt.Point |
getCellSize()
|
java.awt.Point |
getLocation()
|
int |
getMinHeight()
Renvoit la hauteur minimum de la case permettant de voir tout le contenu de celle-ci. |
private java.lang.String |
getRGB(java.awt.Color col)
Convertit un objet Color en code RGB à utiliser en HTML |
int |
getType()
|
private java.lang.String |
getValue(java.lang.String value,
java.lang.String str)
Trouve la valeur de value dans le texte str, ce doit être de la forme "value=qlqc". |
boolean |
hasNextSubTable()
Vérifie si l'itérateur des sous-tableaux dont cette cellule est la première case a encore des éléments. |
void |
initExport()
Initialisation de l'export. |
boolean |
isInSubTable()
Vérifie si la cellule se trouve dans un sous-tableau. |
SpreadSheetApplet.CellArray |
nextSubTable()
Renvoit le sous-tableau, dont cette cellule est la première case, à traiter suivant. |
int |
numSubTables()
Renvoit le nombre de sous-tableaux dans lequel la cellule se trouve. |
void |
putInSubTable(SpreadSheetApplet.CellArray ca)
Informe la cellule qu'elle est placée dans un sous-tableau ca. |
void |
removeFromSubTable(SpreadSheetApplet.CellArray ca)
Informe la cellule qu'elle est retirée du sous-tableau ca. |
void |
restoreState(java.util.Hashtable state)
|
void |
setBold()
|
void |
setBold(boolean b)
|
private void |
setCellCharAttributes(javax.swing.text.AttributeSet attr)
|
private void |
setCellParAttributes(javax.swing.text.AttributeSet attr)
|
void |
setCellSize(java.awt.Point p)
|
void |
setHorizontalAlignment(int a)
|
void |
setItalic()
|
void |
setItalic(boolean b)
|
void |
setLocation(java.awt.Point p)
|
void |
setUnderline()
|
void |
setUnderline(boolean b)
|
void |
storeState(java.util.Hashtable state)
|
java.lang.String |
toHTML(int width,
int height)
|
void |
updateHeight()
Met à jour la hauteur de la ligne du tableau pour pouvoir voir tout le contenu de cette celule. |
Methods inherited from class javax.swing.JTextPane |
addStyle,
createDefaultEditorKit,
getCharacterAttributes,
getInputAttributes,
getLogicalStyle,
getParagraphAttributes,
getStyle,
getStyledDocument,
getStyledEditorKit,
getUIClassID,
insertComponent,
insertIcon,
paramString,
removeStyle,
replaceSelection,
replaceSelection,
setCharacterAttributes,
setDocument,
setEditorKit,
setLogicalStyle,
setParagraphAttributes,
setStyledDocument,
writeObject |
Methods inherited from class javax.swing.JEditorPane |
|
Methods inherited from class javax.swing.text.JTextComponent |
addCaretListener,
addInputMethodListener,
addKeymap,
copy,
createComposedString,
cut,
exchangeCaret,
fireCaretUpdate,
getActions,
getCaret,
getCaretColor,
getCaretListeners,
getCaretPosition,
getCurrentEventModifiers,
getDisabledTextColor,
getDocument,
getDragEnabled,
getFocusAccelerator,
getFocusedComponent,
getHighlighter,
getInputMethodRequests,
getKeymap,
getKeymap,
getMargin,
getNavigationFilter,
getPreferredScrollableViewportSize,
getScrollableBlockIncrement,
getScrollableUnitIncrement,
getSelectedText,
getSelectedTextColor,
getSelectionColor,
getSelectionEnd,
getSelectionStart,
getText,
getToolTipText,
getUI,
installDefaultTransferHandlerIfNecessary,
invokeAction,
isEditable,
isProcessInputMethodEventOverridden,
isProcessInputMethodEventOverridden,
loadKeymap,
mapCommittedTextToAction,
modelToView,
moveCaretPosition,
paste,
processInputMethodEvent,
read,
readObject,
removeCaretListener,
removeKeymap,
removeNotify,
replaceInputMethodText,
select,
selectAll,
setCaret,
setCaretColor,
setCaretPosition,
setComponentOrientation,
setDisabledTextColor,
setDragEnabled,
setEditable,
setFocusAccelerator,
setHighlighter,
setInputMethodCaretPosition,
setKeymap,
setMargin,
setNavigationFilter,
setSelectedTextColor,
setSelectionColor,
setSelectionEnd,
setSelectionStart,
setUI,
shouldSynthensizeKeyEvents,
updateInputMap,
updateUI,
viewToModel,
write |
Methods inherited from class javax.swing.JComponent |
_paintImmediately,
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
adjustPaintFlags,
alwaysOnTop,
checkIfChildObscuredBySibling,
componentInputMapChanged,
computeVisibleRect,
computeVisibleRect,
compWriteObjectNotify,
contains,
createToolTip,
deregisterNextFocusableComponent,
disable,
enable,
enableSerialization,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getActionMap,
getActionMap,
getAlignmentX,
getAlignmentY,
getAncestorListeners,
getAutoscrolls,
getBorder,
getBounds,
getClientProperties,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getCreatedDoubleBuffer,
getDebugGraphicsOptions,
getDefaultLocale,
getFlag,
getGraphics,
getHeight,
getInputMap,
getInputMap,
getInputMap,
getInputVerifier,
getInsets,
getInsets,
getListeners,
getLocation,
getManagingFocusBackwardTraversalKeys,
getManagingFocusForwardTraversalKeys,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getObscuredState,
getPropertyChangeListeners,
getPropertyChangeListeners,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getSuppressDropTarget,
getToolTipLocation,
getToolTipText,
getTopLevelAncestor,
getTransferHandler,
getVerifyInputWhenFocusTarget,
getVetoableChangeListeners,
getVisibleRect,
getWidth,
getWriteObjCounter,
getX,
getY,
grabFocus,
isDoubleBuffered,
isLightweightComponent,
isManagingFocus,
isMaximumSizeSet,
isMinimumSizeSet,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isPreferredSizeSet,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintDoubleBuffered,
paintImmediately,
paintImmediately,
paintWithOffscreenBuffer,
print,
printAll,
printBorder,
printChildren,
printComponent,
processComponentKeyEvent,
processKeyBinding,
processKeyBindings,
processKeyBindingsForAllComponents,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
rectangleIsObscured,
registerKeyboardAction,
registerKeyboardAction,
registerNextFocusableComponent,
registerNextFocusableComponent,
registerWithKeyboardManager,
registerWithKeyboardManager,
removeAncestorListener,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
requestFocus,
requestFocusInWindow,
requestFocusInWindow,
resetKeyboardActions,
reshape,
revalidate,
runInputVerifier,
scrollRectToVisible,
setActionMap,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setCreatedDoubleBuffer,
setDebugGraphicsOptions,
setDefaultLocale,
setDoubleBuffered,
setEnabled,
setFlag,
setFont,
setForeground,
setInputMap,
setInputVerifier,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPaintingChild,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setTransferHandler,
setUI,
setVerifyInputWhenFocusTarget,
setVisible,
setWriteObjCounter,
shouldDebugGraphics,
superProcessMouseMotionEvent,
unregisterKeyboardAction,
unregisterWithKeyboardManager,
unregisterWithKeyboardManager,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
addImpl,
adjustDecendantsOnParent,
adjustDescendants,
adjustListeningChildren,
applyComponentOrientation,
areFocusTraversalKeysSet,
checkGD,
clearCurrentFocusCycleRootOnHide,
clearMostRecentFocusOwnerOnHide,
containsFocus,
countComponents,
countHierarchyMembers,
createChildHierarchyEvents,
createHierarchyEvents,
deliverEvent,
dispatchEventImpl,
dispatchEventToSelf,
doLayout,
eventEnabled,
findComponentAt,
findComponentAt,
findComponentAt,
findTraversalRoot,
getAccessibleAt,
getAccessibleChild,
getAccessibleChildrenCount,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents_NoClientCode,
getComponents,
getContainerListeners,
getDropTargetEventTarget,
getFocusTraversalKeys,
getFocusTraversalPolicy,
getLayout,
getMouseEventTarget,
getMouseEventTarget,
getMouseEventTargetImpl,
initializeFocusTraversalKeys,
initIDs,
insets,
invalidate,
invalidateTree,
isAncestorOf,
isFocusCycleRoot,
isFocusCycleRoot,
isFocusTraversalPolicySet,
layout,
lightweightPaint,
lightweightPrint,
list,
list,
locate,
minimumSize,
nextFocusHelper,
numListening,
paintComponents,
paintHeavyweightComponents,
postProcessKeyEvent,
postsOldMouseEvents,
preferredSize,
preProcessKeyEvent,
printComponents,
printHeavyweightComponents,
processContainerEvent,
processEvent,
proxyEnableEvents,
remove,
remove,
removeAll,
removeContainerListener,
setFocusCycleRoot,
setFocusTraversalKeys,
setFocusTraversalPolicy,
setLayout,
setZOrder,
transferFocusBackward,
transferFocusDownCycle,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addHierarchyBoundsListener,
addHierarchyListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addMouseWheelListener,
adjustListeningChildrenOnParent,
areInputMethodsEnabled,
autoProcessMouseWheel,
autoTransferFocus,
bounds,
checkImage,
checkImage,
checkWindowClosingException,
coalesceEvents,
constructComponentName,
contains,
createBufferStrategy,
createBufferStrategy,
createImage,
createImage,
createVolatileImage,
createVolatileImage,
disableEvents,
dispatchEvent,
dispatchMouseWheelToAncestor,
doAutoTransfer,
enable,
enableEvents,
enableInputMethods,
eventTypeEnabled,
getAccessibleIndexInParent,
getAccessibleStateSet,
getBackground,
getBounds,
getBufferStrategy,
getColorModel,
getComponentListeners,
getComponentOrientation,
getCursor,
getDropTarget,
getFocusCycleRootAncestor,
getFocusListeners,
getFocusTraversalKeys_NoIDCheck,
getFocusTraversalKeysEnabled,
getFont_NoClientCode,
getFont,
getFontMetrics,
getForeground,
getGraphicsConfiguration,
getHierarchyBoundsListeners,
getHierarchyListeners,
getIgnoreRepaint,
getInputContext,
getInputMethodListeners,
getKeyListeners,
getLocale,
getLocationOnScreen_NoTreeLock,
getLocationOnScreen,
getMouseListeners,
getMouseMotionListeners,
getMouseWheelListeners,
getName,
getNativeContainer,
getParent_NoClientCode,
getParent,
getPeer,
getSize,
getToolkit,
getToolkitImpl,
getTreeLock,
gotFocus,
handleEvent,
hasFocus,
hide,
imageUpdate,
inside,
isBackgroundSet,
isCursorSet,
isDisplayable,
isEnabled,
isEnabledImpl,
isFocusable,
isFocusOwner,
isFocusTraversable,
isFocusTraversableOverridden,
isFontSet,
isForegroundSet,
isLightweight,
isRecursivelyVisible,
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,
processMouseEvent,
processMouseWheelEvent,
remove,
removeComponentListener,
removeFocusListener,
removeHierarchyBoundsListener,
removeHierarchyListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removeMouseWheelListener,
repaint,
repaint,
repaint,
requestFocusHelper,
resetGC,
resize,
resize,
setBounds,
setBounds,
setCursor,
setDropTarget,
setFocusable,
setFocusTraversalKeys_NoIDCheck,
setFocusTraversalKeysEnabled,
setGCFromPeer,
setIgnoreRepaint,
setLocale,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus,
transferFocusUpCycle,
updateCursorImmediately |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
Field Detail |
private java.awt.Point position
private java.awt.Point size
private int type
private java.lang.String formula
private SpreadSheetApplet.SpreadSheet spreadSheet
private int inSubTables
private java.util.Vector subTables
private java.util.Iterator tableIter
private int minHeight
Constructor Detail |
public Cell(java.awt.Point p, java.awt.Point s, java.awt.event.MouseListener m, javax.swing.event.UndoableEditListener u, SpreadSheetApplet.SpreadSheet sp)
Point
- p: p.x >= 0, p.y >= 0 : position de la cellulePoint
- s: s.x > 0, s.y > 0 : taille de la celluleMouseListener
- m: listener pour gérer les actions sur les cellulesUndoableEditListener
- u: pour le undo-redo des actions sur
le texte de la celluleSpreadSheet
- sp: tableau contenant cette celluleune nouvelle cellule du tableau est créé et initialisée correctement
public Cell(java.awt.Point p, java.awt.event.MouseListener m, javax.swing.event.UndoableEditListener u, SpreadSheetApplet.SpreadSheet sp)
public Cell(java.awt.Point p)
Method Detail |
public java.awt.Point getLocation()
public void setLocation(java.awt.Point p)
public java.awt.Point getCellSize()
public void setCellSize(java.awt.Point p)
public int getType()
public java.lang.String toHTML(int width, int height)
public void fromHTML(java.lang.String html)
public void storeState(java.util.Hashtable state)
public void restoreState(java.util.Hashtable state)
public boolean isInSubTable()
public int numSubTables()
public void putInSubTable(SpreadSheetApplet.CellArray ca)
CellArray
- ca: sous-tableau contenant cette celluleles variables inSubTables et subTables sont mises à jour
pour tenir compte de l'ajout dans ca
public void removeFromSubTable(SpreadSheetApplet.CellArray ca)
CellArray
- ca: sous-tableau contenant cette celluleles variables inSubTables et subTables sont mises à jour
pour tenir compte du retrait de ca
public void initExport()
tableIter a été recréé à partir de subTables
public boolean hasNextSubTable()
public SpreadSheetApplet.CellArray nextSubTable()
public int getMinHeight()
public void updateHeight()
- la ligne correspondante de spreadSheet est modifiée en hauteur
- minHeight est mis à jour
private void setCellCharAttributes(javax.swing.text.AttributeSet attr)
public void setBold()
public void setBold(boolean b)
public void setItalic()
public void setItalic(boolean b)
public void setUnderline()
public void setUnderline(boolean b)
private void setCellParAttributes(javax.swing.text.AttributeSet attr)
public void setHorizontalAlignment(int a)
private java.lang.String getRGB(java.awt.Color col)
Color
- col: la couleur à convertirprivate java.lang.String getValue(java.lang.String value, java.lang.String str)
String
- value: le texte dont il faut trouver la valeurString
- str: texte dans lequel il faut chercherprivate boolean arrayContains(java.lang.Object[] arr, java.lang.Object o)
Object[]
- arr: tableau dans lequel il faut chercherObject
- o: objet à chercher dans arr
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |