|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
cdox.gui.CDoxFrame
This is the main frame of the CDox graphical application.
Nested Class Summary |
Nested classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
Nested classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
java.io.File |
saveFile
The file which is currently used to save this project in |
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface cdox.edit.CDCoverStandards |
ALL, CDBACK_SIDE, CDBACK_SIDE_SIZE, CDBACK_SIZE, CDBOOKLET, CDBOOKLET_SIZE, CDFRONT, CDFRONT_SIZE, CDSIDE_SIZE, CDX, GIF, JPG, PNG |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CDoxFrame(CDox cdx)
This is the main constructor of the program, if this works everything works. |
|
CDoxFrame(CDox cdox,
java.lang.String filename)
|
Method Summary | |
void |
addCovers(Cover[] whichCovers,
java.lang.String title)
This method adds the drawingPanes to the EditPane, it calls the same method in editpane. |
void |
addCovers(int[] whichCovers)
This method adds the drawingPanes to the EditPane, it calls the same method in editpane. |
void |
center(java.awt.Window win)
Sets the given windows to the center of the screen and packs it. |
int |
checkCloseable()
Checks, if the actual document has been saved. |
void |
checkSaveable()
This method checks to see whether an opened file have to be saved or not. |
void |
configure(boolean show)
If show is true, it shows the configuration dialog, if not, it creates a new one. |
void |
flipElementHorizontal()
Sets the specified horizontal flipping of the selected element. |
void |
flipElementVertical()
Sets the specified Vertical flipping of the selected element. |
java.awt.Font |
getActualFont()
This method returns the actual font. |
int |
getActualFontSize()
This method returns the actualfontSize. |
javax.print.PrintService[] |
getAllPrinters()
Returns all printers on the System, capable of printing this document. |
javax.swing.JColorChooser |
getColorChooser()
This method returns the Colordialog |
Data |
getData()
Returns the Data for the current project or null, if none has been set. |
javax.print.PrintService |
getDefaultPrinter()
Returns the default printer installed on this system. |
EditPane |
getEditPane()
This method returns the editPane |
MyFileChooser |
getFileDialog()
This method returns the fileChooser dialog |
javax.swing.JComboBox |
getFontBox()
This method returns the fontBox (combobox). |
int |
getFontIndex(java.lang.String fontFamily)
Returns the index of the fontfamily, which is coherent with the index of the Font in the fontBox. |
javax.swing.JComboBox |
getFontSizeBox()
This method returns the fontSizeBox (combobox). |
java.lang.String |
getImageDir()
This method returns the directory of the images. |
javax.swing.JMenu |
getImageEditPopupMenu()
Returns the popup imageEditMenu. |
CoverDialog |
getNewDialog()
This method returns the newDialog |
javax.swing.JScrollPane |
getScrollPane()
This Method returns the ScrollPane for use in other classes. |
javax.swing.JToolBar |
getStandardToolBar()
This method returns the toobar |
StatusDrawer |
getStatusDrawer()
This method returns the statusDrawer. |
StatusPane |
getStatusPane()
This method returns the statusPane. |
boolean |
getTextBold()
This method returns true if the text is written in bold. |
java.awt.Color |
getTextColor()
This method returns true if the textcolor. |
boolean |
getTextEnabled()
This method returns if true if the drawingPane is in TextMode. |
boolean |
getTextItalic()
This method returns true if the text is written in italic. |
javax.swing.JToolBar |
getTextToolBar()
This method returns the texttoobar |
boolean |
getTextUnderline()
This method returns true if the text is written with underline. |
CdoxWizard |
getWizardInstance()
|
static void |
handleError(java.lang.Throwable e,
boolean writeLog)
This method should be called from all exceptions, it is able to play a sound and write in the log-file of CDox-errors. |
boolean |
hasBackground()
This method is called when the user wants to change the backgroundimage |
boolean |
isWizardOn()
|
boolean |
isWorking()
This method returns true if the program is calculating something. |
static java.awt.image.BufferedImage |
loadImage(java.io.InputStream in)
Reads an image out of the stream. |
void |
lostOwnership(java.awt.datatransfer.Clipboard c,
java.awt.datatransfer.Transferable contents)
This method is inherited from ClipBoardOwner and does nothing. |
protected void |
processWindowEvent(java.awt.event.WindowEvent we)
Is overwritten from JFrame, it enables the user to cancel the accidentially close click. |
Cover[] |
readDocuments(java.io.File f)
This method will read the contents of the file. |
void |
reEditTextElement()
This method is called when a text object needs to be re-edited. |
void |
removeAllElements()
Removes all elements from the current Cover. |
void |
resetSaveFile()
Sets the default saveFile to null. |
void |
rotateElement(double deg)
Rotates the selected element a by the given degrees. |
void |
run()
In this run method the printers are searched for at start up. |
void |
saveAs(java.io.File f)
Sets the saveFile to f. |
void |
saveFile(java.io.File file)
This Method is concerned whith the saving of a modified or not modified(saveAs)file. |
void |
setActionBorder(java.lang.String actionName)
This method arranges the borders on the textToolBar buttons. |
void |
setActionEnabled(java.lang.String name,
boolean set)
This Method is called to toggle the "for files" appropriate Actions on-or-off. |
void |
setActualFont(java.awt.Font f)
This method sets the Font to write with. |
void |
setActualFontSize(int as)
This method sets fontSize to write with, and updates actualFont. |
void |
setBackgroundColor(java.awt.Color bc)
Sets the backgroundColor of the current cover to the Color bc. |
void |
setBackgroundImage(java.awt.image.BufferedImage bi,
java.lang.String id,
boolean mode)
Passes the BufferedImage to the CDrawingPane with its TempFiles-key and the fit-mode |
void |
setBackgroundImage(java.lang.String id,
boolean mode)
This Method passes the Background image id to the drawPane, and sets the background flag from its parent (activeCover). |
void |
setCutNWasteable(boolean b)
Sets whether we can cut'n'waste objects. |
void |
setData(Data d)
Sets the data for the current project. |
void |
setImage(java.lang.String id)
This Method adds a normal Image to the active cover. |
void |
setMyTitle(java.lang.String s)
Sets the title of the frame. |
void |
setSave(boolean b)
Sets the saveaction and isSaved variable. |
void |
setSelectedElement(Element e)
Sets which element is selected. |
void |
setTextBold(boolean b)
This Method sets whether to write in bold or not |
void |
setTextColor(java.awt.Color tc)
This method sets Fontcolor to write with. |
void |
setTextEnabled(boolean te)
This method is called to set the drawingPane in TextMode. |
void |
setTextItalic(boolean i)
This Method sets whether to write in italic or not |
void |
setTextStylesOff()
This method sets all textstyles like bold, underline and italic off. |
void |
setTextUnderline(boolean u)
This Method sets whether to write in underline or not |
void |
setUndoAction(DoAction undo)
Sets the current undo action. |
void |
setWorking(boolean work)
This method sets the working-icon on or off. |
void |
showNewWizard()
Creates a new ActionEvent with a newAction, and calls its actionperformed method. |
void |
showPopup(java.awt.Component invoker,
int x,
int y,
java.lang.String title)
Sets the popup to be used on the selected element. |
static int |
showQuestion(java.lang.String question,
int option)
This method shows a question dialog to the user, and returns the value the user chosen. |
void |
stop()
Shuts the application down. |
java.lang.String |
toString()
This method returns a String representing this frame. |
void |
updateTextBar(java.lang.String command)
This method is called when the user is in textmode, and klicks on the new button, it "fakes" an action event. |
void |
wizardOn(boolean on,
CdoxWizard wiz)
|
Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, show, toBack, toFront |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Field Detail |
public java.io.File saveFile
Constructor Detail |
public CDoxFrame(CDox cdox, java.lang.String filename)
public CDoxFrame(CDox cdx)
This is the main constructor of the program, if this works everything works. First we add a windowListener to insure that closing is done properly. Then the cdox-icon is set. After that the menubar and its menus are made. There are four menus:
After that the configurable Actions are set(line: 309). Then the fontSizeBox is filled up to 72, and the Fonts are loaded (line: 357). The fonts'actions are added to the font(Size)Box, and some standard stuff for the comboboxes (line: 410).
The Buttons for the textToolBar are created (line: 430), and after that the toolbars are added to an extra panel, which itself will be added together with the statusDrawer (ox) to the NorthPane, which on its turn is added to the contentPane (line: 454).
The ToolbarButtons are added for the textToolBar and the genericToolbar. (line: 365). Actions are set Enabled and some not (line: 501). The File chooser is initialized (so that it recursively can start to go through all disks etc). The EditPane (Which will contain the CDCover's which will contain the CDDrawingPanes, which interact with Cover) is added to a ScrollPane which is added to the ContentPane in the CENTER. The statusPane is added to the SOUTH. The editPane is filled with a front and back-side (line: 539).
All that needs to be done now is the newDialog to initialize and the frame needs to be centered. After this the start-sound is played.
cdx
- a CDox
value.addCovers(int[])
,
center(java.awt.Window)
,
ConfigurationDialog
,
CoverDialog
,
EditAction
,
EditBildAction
,
EditPane
,
FileAction
,
HelpAction
,
InsertAction
,
MyFileChooser
,
StatusDrawer
,
StatusPane
,
TextAction
,
ToolBarPane
Method Detail |
public void run()
run
in interface java.lang.Runnable
public javax.print.PrintService[] getAllPrinters()
public javax.print.PrintService getDefaultPrinter()
public void center(java.awt.Window win)
win
- the window to center on the screen.public static void handleError(java.lang.Throwable e, boolean writeLog)
e
- the Trowable that caused the problemwriteLog
- true to write the problem in the log, false for a normal error
message.public static int showQuestion(java.lang.String question, int option)
question
- the question to be displayedoption
- the JOptionPane options for example JOptionPane.YES_NO_OPTION.
public static java.awt.image.BufferedImage loadImage(java.io.InputStream in)
in
- where to read the image.
public void lostOwnership(java.awt.datatransfer.Clipboard c, java.awt.datatransfer.Transferable contents)
lostOwnership
in interface java.awt.datatransfer.ClipboardOwner
c
- the Clipboard which is this class containscontents
- the content of the Clipboardpublic void setCutNWasteable(boolean b)
b
- whether we can be cut'n'wasted.public javax.swing.JScrollPane getScrollPane()
public EditPane getEditPane()
public javax.swing.JMenu getImageEditPopupMenu()
public StatusPane getStatusPane()
public StatusDrawer getStatusDrawer()
public void setWorking(boolean work)
work
- true if working false if not.public boolean isWorking()
public javax.swing.JToolBar getStandardToolBar()
public javax.swing.JToolBar getTextToolBar()
public MyFileChooser getFileDialog()
public javax.swing.JColorChooser getColorChooser()
public CoverDialog getNewDialog()
public void showNewWizard()
public void wizardOn(boolean on, CdoxWizard wiz)
public boolean isWizardOn()
public CdoxWizard getWizardInstance()
public javax.swing.JComboBox getFontBox()
public javax.swing.JComboBox getFontSizeBox()
public int getFontIndex(java.lang.String fontFamily)
fontFamily
- the String representing the current used font
CaretUpdater.caretUpdate(javax.swing.event.CaretEvent)
public void addCovers(int[] whichCovers)
whichCovers
- an array of ints decribing the kind of covers to be displayed
in this project.public void addCovers(Cover[] whichCovers, java.lang.String title)
whichCovers
- the covers allready created.title
- the new title of the frame, apart from the CDFront/.../ stuff.public void setSave(boolean b)
b
- true means the cover has to be saved.public void resetSaveFile()
public void checkSaveable()
FileAction.actionPerformed(java.awt.event.ActionEvent)
public void saveAs(java.io.File f)
f
- the file to save_as to.public void saveFile(java.io.File file)
file
- is the file to savepublic void setMyTitle(java.lang.String s)
s
- a String which can be a new file, an "*" a "" or the name of the project.setSave(boolean)
,
saveFile
,
EditPane.addCoverTemplates(int[], java.awt.Font, boolean, boolean, boolean, java.awt.Color)
public Cover[] readDocuments(java.io.File f)
f
- the file to read.
public void setActionEnabled(java.lang.String name, boolean set)
name
- the inside-the-program-name for the actionset
- is the boolean to set the actions to.public java.lang.String toString()
public java.lang.String getImageDir()
public void setUndoAction(DoAction undo)
undo
- the action.public void setBackgroundImage(java.lang.String id, boolean mode) throws java.io.IOException
id
- the String which is a valid unique id for the File on diskmode
- the mode.
java.io.IOException
- if an error occurs.Cover.setBackground(String,boolean)
public void setBackgroundImage(java.awt.image.BufferedImage bi, java.lang.String id, boolean mode)
bi
- the allready loaded bufferedbackgroundImageid
- the String which is a valid unique id for the File on diskmode
- the mode.public void setBackgroundColor(java.awt.Color bc)
bc
- the new backgroundColorpublic boolean hasBackground()
public void setImage(java.lang.String id) throws java.io.IOException
id
- the String which is a valid unique id for the File on disk
java.io.IOException
- if an error occurs.public void setTextEnabled(boolean te)
te
- true if entering text mode, false otherwhise.public boolean getTextEnabled()
public void updateTextBar(java.lang.String command)
command
- defining what happens, if on one cover in textmode clicked on
another cover command will be "cover" else its null.TextAction.actionPerformed(java.awt.event.ActionEvent)
public void setActionBorder(java.lang.String actionName)
actionName
- the name of the action to set the Border.public void setTextStylesOff()
public java.awt.Font getActualFont()
public void setActualFont(java.awt.Font f)
f
- the font to write with.public int getActualFontSize()
public void setActualFontSize(int as)
as
- the font size to write with.public void setTextBold(boolean b)
b
- true to write in bold false otherwhise.public void setTextUnderline(boolean u)
u
- true to write in underline false otherwhise.public void setTextItalic(boolean i)
i
- true to write in italic false otherwhise.public boolean getTextBold()
public boolean getTextUnderline()
public boolean getTextItalic()
public void setTextColor(java.awt.Color tc)
tc
- the fontcolor to write with.public java.awt.Color getTextColor()
public void rotateElement(double deg)
deg
- the degrees by which to rotate, for example 90.public void flipElementHorizontal()
public void flipElementVertical()
public void reEditTextElement()
public void removeAllElements()
public void showPopup(java.awt.Component invoker, int x, int y, java.lang.String title)
invoker
- the active drawing pane,x
- the x-position of the popup menu,y
- the y-position of the popup menu,title
- the title of the popup.public void setSelectedElement(Element e)
e
- the element, or null, if no element should be selected.public void configure(boolean show)
show
- whether to show or create a new configuration dialog.public void stop()
public int checkCloseable()
protected void processWindowEvent(java.awt.event.WindowEvent we)
we
- the WindowEvent.public Data getData()
public void setData(Data d)
d
- the new data.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |