Class DeckEditor
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JInternalFrame
-
- ca.cgjennings.apps.arkham.AbstractStrangeEonsEditor
-
- ca.cgjennings.apps.arkham.AbstractGameComponentEditor<Deck>
-
- ca.cgjennings.apps.arkham.deck.DeckEditor
-
- All Implemented Interfaces:
Commandable
,StrangeEonsEditor
,FileChangeListener
,TabbedPaneReorderListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.awt.print.Printable
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
public final class DeckEditor extends AbstractGameComponentEditor<Deck> implements java.awt.print.Printable, TabbedPaneReorderListener, FileChangeListener
Editor for decks of cards (collections of game components laid out on pages) and custom expansion boards.- Since:
- 1.62
- Author:
- Chris Jennings
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
-
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
-
Nested classes/interfaces inherited from interface ca.cgjennings.apps.arkham.StrangeEonsEditor
StrangeEonsEditor.EditorListener, StrangeEonsEditor.FieldPopulationListener, StrangeEonsEditor.HeartbeatListener
-
-
Field Summary
-
Fields inherited from class ca.cgjennings.apps.arkham.AbstractGameComponentEditor
previewSplitPane, sheets, viewers
-
Fields inherited from class ca.cgjennings.apps.arkham.AbstractStrangeEonsEditor
DEFAULT_EDITOR_ICON
-
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
-
Fields inherited from class javax.swing.JComponent
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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description DeckEditor()
Creates a new deck editor with a new, emptyDeck
attached.DeckEditor(Deck d)
Creates a new deck editor for the specifiedDeck
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCards(java.lang.Object[] cards)
void
addCards(java.util.List<PageItem> cards)
void
addFilesToCardList(java.io.File[] files)
Page
addPage()
Create a new, blank page and add it to the end of the deck.boolean
canPerformCommand(AbstractCommand command)
Returnstrue
if the commandable wishes to handle the given command.protected void
clearImpl()
Clears the component by calling itsGameComponent.clearAll()
method, then repopulating the editor controls.PageItem
createStandardTile(java.lang.String name)
Creates an instance of the tile with the specified name.void
dispose()
Releases resources when the editor will no longer be used.protected void
exportImpl()
Implements EXPORT for decks.void
fileChanged(java.io.File f, FileChangeMonitor.ChangeType type)
This method is called when a change is detected in a file being monitored by aFileChangeMonitor
.Page
getActivePage()
Returns the active deck page, ornull
.PageView
getActivePageView()
Returns the page view of the currently edited page, ornull
.javax.swing.border.Border
getBorder()
Deck
getDeck()
Return the deck instance the editor controls for non-interactive editing.protected java.lang.String
getDefaultFileName()
Returns a default file name for a game component that hasn't been saved.javax.swing.Icon
getFrameIcon()
Returns the editor window icon.int
getSelectedPageIndex()
void
handleOpenRequest(Deck newCharacter, java.io.File path)
After installing the component, make sure you update the component object.boolean
isAttached()
Returnstrue
if this editor is currently attached to the document tab strip.boolean
isCommandApplicable(AbstractCommand command)
Returnstrue
if thecommand
can be performed by this commandable in its current state.void
performCommand(AbstractCommand command)
Performs the command.protected void
populateComponentFromDelayedFields()
This method is called during heartbeats to allow the editor to update properties of the game component that either cannot be updated in response to events or that are more efficient when updated periodically instead of immediately.void
populateFieldsFromComponent()
Updates the editor with the current contents of the game component.void
print()
Displays a dialog that allows the user to print the deck.void
print(boolean direct)
Prints the content of this deck editor.int
print(java.awt.Graphics g1, java.awt.print.PageFormat pf, int pageIndex)
protected void
printImpl(java.awt.print.PrinterJob printJob)
Implementation of the print command for standard game components.void
redrawPreview()
Forces the editor to redraw its component preview.void
removeCurrentPage()
void
replaceEditedComponent(Deck newCharacter)
Replace the currently edited component.void
save()
Saves this editor's content to its current save location.void
selectBestPaper(double pageWidth, double pageHeight)
Selects the paper closest to the specified dimensions of those currently included in the deck's paper list.void
setAttached(boolean attach)
Sets whether this editor is attached to the document tab strip.void
setCurrentPage(int i)
void
setFrameIcon(javax.swing.Icon icon)
Sets the preferred icon to use for this editor window.void
setGameComponent(Deck component)
Sets the edited game component.void
setPaperProperties(PaperProperties p)
void
tabbedPanesReordered(JReorderableTabbedPane source, int oldindex, int newindex)
-
Methods inherited from class ca.cgjennings.apps.arkham.AbstractGameComponentEditor
addFieldPopulationListener, export, fireFieldPopulationEvent, forceRerender, getFileNameExtension, getFileTypeDescription, getGameComponent, getSelectedSheet, getSelectedSheetIndex, getSheet, getSheetCount, getSheetLabels, hasUnsavedChanges, initializeSheetViewers, localizeComboBoxLabels, localizeComboBoxLabels, localizeComponentTree, localizeForPlatform, onHeartbeat, removeFieldPopulationListener, saveAs, saveImpl, setDesignSupport, setSelectedSheetIndex, setUnsavedChanges, spinOff, spinOffImpl, updateSheetViewers
-
Methods inherited from class ca.cgjennings.apps.arkham.AbstractStrangeEonsEditor
addEditorListener, addHeartbeatListener, clear, close, confirmLossOfUnsavedChanges, createTimer, createTimer, doDefaultCloseAction, fireHeartbeatEvent, getFile, getTabStripPopupMenu, getTitle, getToolTipText, removeAllStrangeEonsListeners, removeEditorListener, removeHeartbeatListener, resumeTimedUpdates, select, setFile, setTitle, setToolTipText, stopTimedUpdates, toString
-
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getGlassPane, getInternalFrameListeners, getJMenuBar, getLastCursor, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setCursor, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setUI, show, toBack, toFront, 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, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ca.cgjennings.apps.arkham.StrangeEonsEditor
getFrameIcon, isAttached, setAttached, setFrameIcon
-
-
-
-
Method Detail
-
getDeck
public Deck getDeck()
Return the deck instance the editor controls for non-interactive editing.- Returns:
- the edited deck
-
getActivePage
public Page getActivePage()
Returns the active deck page, ornull
.- Returns:
- the currently edited page
-
getActivePageView
public PageView getActivePageView()
Returns the page view of the currently edited page, ornull
.- Returns:
- the view component of the active page
-
createStandardTile
public PageItem createStandardTile(java.lang.String name)
Creates an instance of the tile with the specified name.- Parameters:
name
- the name of the tile to create (the first line of the tile's entry in its tile set file)- Returns:
- a new instance of a tile with the specified name
- Throws:
java.lang.IllegalArgumentException
- if no tile with the requested name exists
-
tabbedPanesReordered
public void tabbedPanesReordered(JReorderableTabbedPane source, int oldindex, int newindex)
- Specified by:
tabbedPanesReordered
in interfaceTabbedPaneReorderListener
-
selectBestPaper
public void selectBestPaper(double pageWidth, double pageHeight)
Selects the paper closest to the specified dimensions of those currently included in the deck's paper list. This method is provided as a convenience for scripts that are setting up expansion boards. (Note that if the paper is for a specific game, you may need to set that game's code in the deck's private settings and reload the paper list before the desired size will be available.)- Parameters:
pageWidth
- the width of the desired paperpageHeight
- the height of the desired paper
-
addPage
public Page addPage()
Create a new, blank page and add it to the end of the deck.
-
addCards
public void addCards(java.lang.Object[] cards)
-
addCards
public void addCards(java.util.List<PageItem> cards)
-
populateFieldsFromComponent
public void populateFieldsFromComponent()
Description copied from class:AbstractGameComponentEditor
Updates the editor with the current contents of the game component. Subclasses should call the super implementation last to ensure that field population events are fired to any listeners.- Overrides:
populateFieldsFromComponent
in classAbstractGameComponentEditor<Deck>
-
populateComponentFromDelayedFields
protected void populateComponentFromDelayedFields()
Description copied from class:AbstractGameComponentEditor
This method is called during heartbeats to allow the editor to update properties of the game component that either cannot be updated in response to events or that are more efficient when updated periodically instead of immediately. If a component has no properties that fit this description, then subclasses can provide an empty implementation.- Specified by:
populateComponentFromDelayedFields
in classAbstractGameComponentEditor<Deck>
-
redrawPreview
public void redrawPreview()
Description copied from class:AbstractGameComponentEditor
Forces the editor to redraw its component preview. Editors normally manage this redrawing automatically. However, if you make an indirect change to a component, such as changing a setting that affects how the card is drawn, the editor will have no way of knowing about this change and the preview will not reflect the change. Calling this method forces all editors to redraw their previews from scratch.- Overrides:
redrawPreview
in classAbstractGameComponentEditor<Deck>
- See Also:
StrangeEonsAppWindow.redrawPreviews()
-
clearImpl
protected void clearImpl()
Description copied from class:AbstractGameComponentEditor
Clears the component by calling itsGameComponent.clearAll()
method, then repopulating the editor controls.- Overrides:
clearImpl
in classAbstractGameComponentEditor<Deck>
- See Also:
AbstractGameComponentEditor.populateFieldsFromComponent()
-
exportImpl
protected void exportImpl()
Implements EXPORT for decks. Since decks do not have sheets, this exports an image of each deck page.- Overrides:
exportImpl
in classAbstractGameComponentEditor<Deck>
- See Also:
ImageExporter
,ExportContainer
-
canPerformCommand
public boolean canPerformCommand(AbstractCommand command)
Description copied from class:AbstractGameComponentEditor
Returnstrue
if the commandable wishes to handle the given command. This method defines the set of commands that the commandable responds to. The commandable might not be able to act on the command at the current moment. For example, a commandable that responds to "Cut" could return true from this method, but false fromAbstractGameComponentEditor.isCommandApplicable(ca.cgjennings.apps.arkham.commands.AbstractCommand)
if there is currently no selection to cut.The base class for game component editors returns true for the following standard commands:
CLEAR
,EXPORT
,PRINT
,SAVE
,SAVE_AS
, andSPIN_OFF
.- Specified by:
canPerformCommand
in interfaceCommandable
- Specified by:
canPerformCommand
in interfaceStrangeEonsEditor
- Overrides:
canPerformCommand
in classAbstractGameComponentEditor<Deck>
- Parameters:
command
- the command to be performed- Returns:
true
if this commandable wishes to handle the command (even if it cannot execute the command currently)- See Also:
Commands
-
isCommandApplicable
public boolean isCommandApplicable(AbstractCommand command)
Description copied from class:AbstractStrangeEonsEditor
Returnstrue
if thecommand
can be performed by this commandable in its current state. IfCommandable.canPerformCommand(ca.cgjennings.apps.arkham.commands.AbstractCommand)
would return false for this command, then this must also return false. The base class returns the value ofAbstractStrangeEonsEditor.canPerformCommand(ca.cgjennings.apps.arkham.commands.AbstractCommand)
, except that if the command is SAVE, it returns false if the editor does not have unsaved changes.- Specified by:
isCommandApplicable
in interfaceCommandable
- Specified by:
isCommandApplicable
in interfaceStrangeEonsEditor
- Overrides:
isCommandApplicable
in classAbstractGameComponentEditor<Deck>
- Parameters:
command
- the command to be performed- Returns:
true
if this commandable can currently perform the command
-
performCommand
public void performCommand(AbstractCommand command)
Description copied from class:AbstractStrangeEonsEditor
Performs the command. IfCommandable.isCommandApplicable(ca.cgjennings.apps.arkham.commands.AbstractCommand)
would returnfalse
for this command, then this should do nothing.The base class provides a framework for handling common document commands. To use the framework, override
AbstractStrangeEonsEditor.canPerformCommand(ca.cgjennings.apps.arkham.commands.AbstractCommand)
to return true for the commands you wish to support. Then this method will call the following methods (as appropriate): null null nullAbstractStrangeEonsEditor.clear()
,AbstractStrangeEonsEditor.save()
,AbstractStrangeEonsEditor.saveAs()
,AbstractStrangeEonsEditor.export()
,AbstractStrangeEonsEditor.spinOff()
, orAbstractStrangeEonsEditor.print()
. These methods handle common details of implementing these commands, then pass control to a matching implementation method which the subclass must override to perform those aspects of the command which are unique to the editor's content.For example, to implement document saving, a subclass would override
AbstractStrangeEonsEditor.canPerformCommand(ca.cgjennings.apps.arkham.commands.AbstractCommand)
to return true for the SAVE and SAVE_AS commands, then overrideAbstractStrangeEonsEditor.saveImpl(java.io.File)
to write the editor content to the provided file.- Specified by:
performCommand
in interfaceCommandable
- Specified by:
performCommand
in interfaceStrangeEonsEditor
- Overrides:
performCommand
in classAbstractGameComponentEditor<Deck>
- Parameters:
command
- the command to perform
-
replaceEditedComponent
public void replaceEditedComponent(Deck newCharacter)
Description copied from class:AbstractGameComponentEditor
Replace the currently edited component. This consists of the following steps:- if
newComponent
has an on-install event in its private settings, then the on-install event is called - the editor is updated to point to
newComponent
and it creates a new set of sheets fromnewComponent
and installs them in the preview window - the current state of
newComponent
is copied from the component to the editor controls
- Overrides:
replaceEditedComponent
in classAbstractGameComponentEditor<Deck>
- Parameters:
newCharacter
- the new component to edit with this editor
- if
-
save
public void save()
Description copied from class:AbstractStrangeEonsEditor
Saves this editor's content to its current save location. If it has not been saved previously, and the command is supported, the user will be prompted to select a file (seeStrangeEonsEditor.saveAs()
).Note that an editor can support the SAVE_AS command without supporting the SAVE command, but not vice-versa. This implementation handles the details of determining the file to be written and exception handling. If
AbstractStrangeEonsEditor.getFile()
returnsnull
, this method callsAbstractStrangeEonsEditor.saveAs()
to determine the file to save to. Otherwise, it callsAbstractStrangeEonsEditor.saveImpl(java.io.File)
to write the file. To use it, overrideAbstractStrangeEonsEditor.saveImpl(java.io.File)
.- Specified by:
save
in interfaceStrangeEonsEditor
- Overrides:
save
in classAbstractGameComponentEditor<Deck>
- See Also:
StrangeEonsEditor.canPerformCommand(ca.cgjennings.apps.arkham.commands.AbstractCommand)
-
handleOpenRequest
public void handleOpenRequest(Deck newCharacter, java.io.File path)
Description copied from class:AbstractGameComponentEditor
After installing the component, make sure you update the component object.- Overrides:
handleOpenRequest
in classAbstractGameComponentEditor<Deck>
- Parameters:
newCharacter
- the new component being openedpath
- the file path from which the component was loaded
-
getDefaultFileName
protected java.lang.String getDefaultFileName()
Description copied from class:AbstractGameComponentEditor
Returns a default file name for a game component that hasn't been saved.- Overrides:
getDefaultFileName
in classAbstractGameComponentEditor<Deck>
- Returns:
- a default file name, including extension, based on the name of the installed component
-
print
public void print()
Displays a dialog that allows the user to print the deck. If the user elects to proceed with the print,printImpl(java.awt.print.PrinterJob)
will be called to perform the actual printing.The displayed dialog also allows the user to modify page splitting options, which are used to tile large deck pages onto a smaller physical page size.
- Specified by:
print
in interfaceStrangeEonsEditor
- Overrides:
print
in classAbstractStrangeEonsEditor
- See Also:
AbstractStrangeEonsEditor.printImpl(java.awt.print.PrinterJob)
-
print
public void print(boolean direct)
Prints the content of this deck editor. If a direct print is specified, then then no further deck-related options are offered first. Only the platform-specific print dialog, if any, is displayed before printing begins.- Parameters:
direct
- iftrue
, no deck-specific print options are shown
-
printImpl
protected void printImpl(java.awt.print.PrinterJob printJob) throws javax.print.PrintException, java.awt.print.PrinterException
Description copied from class:AbstractGameComponentEditor
Implementation of the print command for standard game components. Lays out the sheets to be printed on one or more pages and then prints the layout.- Overrides:
printImpl
in classAbstractGameComponentEditor<Deck>
- Parameters:
printJob
- a printer job; this value is ignored as this implementation will create its own printer job- Throws:
javax.print.PrintException
- if an error occurs during printingjava.awt.print.PrinterException
- if a printer error occurs during printing
-
print
public int print(java.awt.Graphics g1, java.awt.print.PageFormat pf, int pageIndex)
- Specified by:
print
in interfacejava.awt.print.Printable
-
setPaperProperties
public void setPaperProperties(PaperProperties p)
-
removeCurrentPage
public void removeCurrentPage()
-
setCurrentPage
public void setCurrentPage(int i)
-
addFilesToCardList
public void addFilesToCardList(java.io.File[] files)
-
fileChanged
public void fileChanged(java.io.File f, FileChangeMonitor.ChangeType type)
Description copied from interface:FileChangeListener
This method is called when a change is detected in a file being monitored by aFileChangeMonitor
. Note that this method will typically be called from a different thread than the one that requested notification.- Specified by:
fileChanged
in interfaceFileChangeListener
- Parameters:
f
- the file that has changed
-
dispose
public void dispose()
Description copied from class:AbstractStrangeEonsEditor
Releases resources when the editor will no longer be used. Note that although windows can typically be redisplayed after being disposed of by simply making them visible, editors are not designed to be used after this method is called.Note: This method should not typically be called by plug-in code. If you wish to close an open editor, call its
AbstractStrangeEonsEditor.close()
method instead.- Overrides:
dispose
in classAbstractGameComponentEditor<Deck>
-
setGameComponent
public void setGameComponent(Deck component)
Description copied from class:AbstractGameComponentEditor
Sets the edited game component. If the game component is not appropriate for the editor, the result is undefined.- Overrides:
setGameComponent
in classAbstractGameComponentEditor<Deck>
- Parameters:
component
- the new game component
-
getSelectedPageIndex
public int getSelectedPageIndex()
-
getBorder
public final javax.swing.border.Border getBorder()
- Overrides:
getBorder
in classjavax.swing.JComponent
-
setFrameIcon
public void setFrameIcon(javax.swing.Icon icon)
Sets the preferred icon to use for this editor window. This icon may be used to represent the window in various parts of the application interface. Possible example uses include the following: the document tab, the editor's item in the Window menu, and the frame icon of the editor's detached window. Note, however, that there is no guarantee that the icon will be used, or how. Furthermore, the icon may be used in modified form.- Overrides:
setFrameIcon
in classjavax.swing.JInternalFrame
- Parameters:
icon
- the preferred icon for the editor window- See Also:
JInternalFrame.getFrameIcon()
-
getFrameIcon
public javax.swing.Icon getFrameIcon()
Returns the editor window icon.- Overrides:
getFrameIcon
in classjavax.swing.JInternalFrame
- Returns:
- the icon for the editor, or
null
if no icon is set
-
setAttached
public void setAttached(boolean attach)
Sets whether this editor is attached to the document tab strip. Iftrue
, the editor is attached; this is the default state for new editors. Iffalse
, the editor is detached from the tab strip. When detached, the editor appears in its own floating window separate from the main application window. The editor reattaches when the window is closed.- Parameters:
attach
- iftrue
, attaches the window to the tab strip
-
isAttached
public boolean isAttached()
Returnstrue
if this editor is currently attached to the document tab strip.- Returns:
true
if the editor is attached- See Also:
setAttached(boolean)
-
-