net.yagga.miniinstaller.gui
Class InstallFrame
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--java.awt.Window
|
+--java.awt.Frame
|
+--javax.swing.JFrame
|
+--net.yagga.miniinstaller.gui.InstallFrame
- All Implemented Interfaces:
- javax.accessibility.Accessible, CanFwdListener, FinalExecuter, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants
- public class InstallFrame
- extends javax.swing.JFrame
- implements CanFwdListener, FinalExecuter
Main Frame for installer.
This frame handles communication with MiniInstaller class,
and dispatch every call to specialized Panels.
It keeps custom colors, data, and dimension..
The actual interface is built the first time the Frame is shown, and NOT
at constructor time!
- Author:
- Walter Gamba
- See Also:
- Serialized Form
| Inner classes inherited from class javax.swing.JFrame |
javax.swing.JFrame.AccessibleJFrame |
| Inner classes inherited from class java.awt.Frame |
java.awt.Frame.AccessibleAWTFrame |
| Inner classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock |
| Fields inherited from class javax.swing.JFrame |
accessibleContext, defaultCloseOperation, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis |
| Fields inherited from class java.awt.Window |
active, dbg, focusMgr, inputContext, inputContextLock, OPENED, ownedWindowList, warningString, windowListener, windowSerializedDataVersion |
| Fields inherited from class java.awt.Container |
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, listeningBoundsChildren, listeningChildren, maxSize, ncomponents, printing, printingThreads |
| Fields inherited from class java.awt.Component |
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y |
| 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 |
|
Method Summary |
private int |
_showOptionDialog(java.awt.Component parentComponent,
java.lang.Object message,
java.lang.String title,
int optionType,
int messageType,
javax.swing.Icon icon,
java.lang.Object[] options,
java.lang.Object initialValue)
Copied from JDK's JOptionPane method of same name |
private void |
addPanel(InstallPanel p)
|
void |
bk()
|
void |
canFwd()
canFwdListener |
void |
changeTitle(java.lang.String t)
|
(package private) static void |
deepSet(javax.swing.JComponent jc,
boolean opaque)
Recursive sets opaque false and font and colors for components |
void |
doAlert(java.lang.String msg,
boolean block)
|
void |
doDisplay(java.lang.String msg)
|
void |
doFinal(java.lang.String title,
java.lang.String msg,
java.lang.String shellCommand,
java.lang.String shellCaption)
|
void |
doInput(java.lang.String title,
java.lang.String msg,
java.lang.String defValue)
|
void |
doInputFile(java.lang.String title,
java.lang.String msg,
java.lang.String defValue,
boolean file)
inputs files or Directories |
void |
doShow(java.lang.String imgFile)
|
void |
doStart(java.lang.String title,
java.lang.String msg,
boolean isImage)
|
void |
doStep()
|
void |
doUnzip(java.lang.String title,
java.lang.String zipf,
java.lang.String ddir)
|
void |
doWrite(java.lang.String title,
java.lang.String msg)
|
void |
doWrite(java.lang.String title,
java.lang.String msg,
boolean go)
|
private void |
enableAllButtons()
|
private void |
enableAllButtonsButBk()
|
private void |
enableAllButtonsButFwd()
|
void |
executeShellOnExit(boolean execute)
FinalExecuter interface.
|
void |
exit()
called by nav panel |
void |
fwd()
|
java.lang.String |
getInput()
|
private void |
jbInit()
|
void |
rebuild()
Forces a rebuild of everything.. |
void |
refresh()
|
private void |
reset()
utils |
void |
revertStep()
|
void |
revertStep(int to)
|
void |
setCol(java.lang.String what,
int r,
int g,
int b)
|
void |
setFont(java.lang.String font,
java.lang.String face,
int style,
int size)
|
void |
setLookAndFeel(java.lang.String laf)
Changes the look and feel of the installer |
void |
setName(java.lang.String n)
|
void |
setProgress(int i)
|
void |
setStepVisible(boolean show)
|
void |
setVisible(boolean vis)
|
boolean |
shouldExecuteShell()
|
void |
updateDims(java.awt.Dimension d)
|
| Methods inherited from class javax.swing.JFrame |
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Frame |
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject |
| Methods inherited from class java.awt.Window |
addOwnedWindow, addWindowListener, adjustListeningChildren, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, resetGC, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, applyOrientation, checkGD, countComponents, createChildHierarchyEvents, createHierarchyEvents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, findComponentAt, getAccessibleAt, getAccessibleChild, getAccessibleChildrenCount, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPaint, lightweightPrint, list, list, locate, minimumSize, numListening, paint, paintComponents, paintHeavyweightComponents, postsOldMouseEvents, preferredSize, print, printComponents, printHeavyweightComponents, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, setFont, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, 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, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setSize, setSize, show, size, toString, transferFocus |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
mac
private java.lang.String mac
metal
private java.lang.String metal
motif
private java.lang.String motif
windows
private java.lang.String windows
borderLayout1
java.awt.BorderLayout borderLayout1
navPanel
NavPanel navPanel
titlePanel
TitlePanel titlePanel
stepPanel
StepPanel stepPanel
DEF_X
private static final int DEF_X
DEF_Y
private static final int DEF_Y
title
private java.lang.String title
panelTitle
private java.lang.String panelTitle
panelDim
public static java.awt.Dimension panelDim
BK_COL
public static java.awt.Color BK_COL
FG_COL
public static java.awt.Color FG_COL
TIT_COL
public static java.awt.Color TIT_COL
TITLE_COL
public static java.awt.Color TITLE_COL
STEP_COL
public static java.awt.Color STEP_COL
BTN_COL
public static java.awt.Color BTN_COL
COL_BG
private static final java.lang.String COL_BG
- parser constants
COL_TITLE
private static final java.lang.String COL_TITLE
COL_SMALL_TITLE
private static final java.lang.String COL_SMALL_TITLE
COL_TEXT
private static final java.lang.String COL_TEXT
COL_STEP
private static final java.lang.String COL_STEP
COL_BTN
private static final java.lang.String COL_BTN
FONT_TITLE
private static final java.lang.String FONT_TITLE
FONT_STEP
private static final java.lang.String FONT_STEP
FONT_TEXT
private static final java.lang.String FONT_TEXT
FONT_SMALL_TITLE
private static final java.lang.String FONT_SMALL_TITLE
canRefresh
private boolean canRefresh
- allows refresh only when interface is built
executeShell
private boolean executeShell
- internal: store if user wants to execute shell command on exit
stepVisible
private boolean stepVisible
- store visibility for step panel
installer
private MiniInstaller installer
thisFrame
private InstallFrame thisFrame
- to be used by inner classes
panel
InstallPanel panel
- called by MiniInstaller
input
InputPanel input
unzip
UnzipPanel unzip
updateUI
java.lang.Runnable updateUI
InstallFrame
public InstallFrame(MiniInstaller mi,
java.lang.String title)
setVisible
public void setVisible(boolean vis)
- Overrides:
setVisible in class java.awt.Component
rebuild
public void rebuild()
- Forces a rebuild of everything..
jbInit
private void jbInit()
throws java.lang.Exception
setLookAndFeel
public void setLookAndFeel(java.lang.String laf)
- Changes the look and feel of the installer
- Parameters:
laf - the look and feel: at the moment it can be one among:
windows
metal
motif
mac
updateDims
public void updateDims(java.awt.Dimension d)
setCol
public void setCol(java.lang.String what,
int r,
int g,
int b)
setFont
public void setFont(java.lang.String font,
java.lang.String face,
int style,
int size)
setName
public void setName(java.lang.String n)
- Overrides:
setName in class java.awt.Component
doStep
public void doStep()
revertStep
public void revertStep()
revertStep
public void revertStep(int to)
changeTitle
public void changeTitle(java.lang.String t)
refresh
public void refresh()
doFinal
public void doFinal(java.lang.String title,
java.lang.String msg,
java.lang.String shellCommand,
java.lang.String shellCaption)
doWrite
public void doWrite(java.lang.String title,
java.lang.String msg)
doWrite
public void doWrite(java.lang.String title,
java.lang.String msg,
boolean go)
doStart
public void doStart(java.lang.String title,
java.lang.String msg,
boolean isImage)
doAlert
public void doAlert(java.lang.String msg,
boolean block)
setStepVisible
public void setStepVisible(boolean show)
doDisplay
public void doDisplay(java.lang.String msg)
doShow
public void doShow(java.lang.String imgFile)
doUnzip
public void doUnzip(java.lang.String title,
java.lang.String zipf,
java.lang.String ddir)
setProgress
public void setProgress(int i)
doInput
public void doInput(java.lang.String title,
java.lang.String msg,
java.lang.String defValue)
doInputFile
public void doInputFile(java.lang.String title,
java.lang.String msg,
java.lang.String defValue,
boolean file)
- inputs files or Directories
- Parameters:
file - if true looks for a file, if false, for a directory
getInput
public java.lang.String getInput()
reset
private void reset()
- utils
enableAllButtons
private void enableAllButtons()
enableAllButtonsButFwd
private void enableAllButtonsButFwd()
enableAllButtonsButBk
private void enableAllButtonsButBk()
addPanel
private void addPanel(InstallPanel p)
exit
public void exit()
- called by nav panel
deepSet
static void deepSet(javax.swing.JComponent jc,
boolean opaque)
- Recursive sets opaque false and font and colors for components
- Parameters:
jc -
_showOptionDialog
private int _showOptionDialog(java.awt.Component parentComponent,
java.lang.Object message,
java.lang.String title,
int optionType,
int messageType,
javax.swing.Icon icon,
java.lang.Object[] options,
java.lang.Object initialValue)
- Copied from JDK's JOptionPane method of same name
- See Also:
javax.swing.JOptionPane
bk
public void bk()
fwd
public void fwd()
canFwd
public void canFwd()
- canFwdListener
- Specified by:
canFwd in interface CanFwdListener
executeShellOnExit
public void executeShellOnExit(boolean execute)
- FinalExecuter interface.
Called by FinalPanel to notify user has chosen to execute, or not.. shell
command on exit
- Specified by:
executeShellOnExit in interface FinalExecuter
- Parameters:
execute - if true, command (if any) is executed on exit of the interface..
shouldExecuteShell
public boolean shouldExecuteShell()