ij2x.plugin
Class ControlbarJPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by ij2x.plugin.ControlbarJPanel
All Implemented Interfaces:
PlugIn, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible

public class ControlbarJPanel
extends javax.swing.JPanel
implements PlugIn, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.lang.Runnable

Title:

Description:

Copyright: Copyright (c) 2012

Company:

Version:
1.0
Author:
not attributable
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 javax.swing.JButton action
           
 javax.swing.JLabel clockLabel
           
 javax.swing.JButton closeButton
           
 javax.swing.JPanel controlBarPanel
           
static java.lang.String copyAction
           
static java.lang.String cutAction
           
static int DOUBLE_CLICK_THRESHOLD
           
 javax.swing.JButton draggedButton
           
 javax.swing.JButton infoButton
           
 javax.swing.JLabel label
           
static java.lang.String openAction
           
 javax.swing.JPanel panel
           
 javax.swing.JLabel spaceLabel
           
 javax.swing.JButton undecoratedButton
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ControlbarJPanel()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 javax.swing.JPanel createControlBar()
          Create the toolbar.
 java.lang.String getTimeFormatToString()
           
static boolean hasAlpha(java.awt.Image image)
          This method returns true if the specified image has transparent pixels Code taken from the Java Developers Almanac 1.4 http://javaalmanac.com/egs/java.awt.image/HasAlpha.html
 void labelEvent(java.awt.event.MouseEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void run()
           
 void run(java.lang.String arg)
          This method is called when the plugin is loaded.
 void setDate(java.util.Date date)
           
 void setTimeFormatToString(java.lang.String time)
           
static java.awt.image.BufferedImage[] split(java.awt.Image image, int count, boolean isHorizontal)
          Splits an image into count subimages.
static java.awt.image.BufferedImage[][] splitAll(java.awt.Image image, int arraycount, int count, boolean isHorizontal)
          Splits an image into count subimages.
 void start()
           
 void stop()
           
static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)
           
static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image, java.awt.Image icon)
           
static java.awt.image.BufferedImage toBufferedImage(java.awt.Image borderImage, java.awt.Image bgImage, java.awt.Image imageIcon)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, 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, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

infoButton

public javax.swing.JButton infoButton

draggedButton

public javax.swing.JButton draggedButton

closeButton

public javax.swing.JButton closeButton

undecoratedButton

public javax.swing.JButton undecoratedButton

action

public javax.swing.JButton action

DOUBLE_CLICK_THRESHOLD

public static final int DOUBLE_CLICK_THRESHOLD
See Also:
Constant Field Values

controlBarPanel

public javax.swing.JPanel controlBarPanel

spaceLabel

public javax.swing.JLabel spaceLabel

clockLabel

public javax.swing.JLabel clockLabel

label

public javax.swing.JLabel label

panel

public javax.swing.JPanel panel

cutAction

public static final java.lang.String cutAction
See Also:
Constant Field Values

copyAction

public static final java.lang.String copyAction
See Also:
Constant Field Values

openAction

public static final java.lang.String openAction
See Also:
Constant Field Values
Constructor Detail

ControlbarJPanel

public ControlbarJPanel()
Method Detail

run

public void run(java.lang.String arg)
Description copied from interface: PlugIn
This method is called when the plugin is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt.

Specified by:
run in interface PlugIn

createControlBar

public javax.swing.JPanel createControlBar()
Create the toolbar. By default this reads the resource file for the definition of the toolbar.


labelEvent

public void labelEvent(java.awt.event.MouseEvent e)

split

public static java.awt.image.BufferedImage[] split(java.awt.Image image,
                                                   int count,
                                                   boolean isHorizontal)
Splits an image into count subimages.


splitAll

public static java.awt.image.BufferedImage[][] splitAll(java.awt.Image image,
                                                        int arraycount,
                                                        int count,
                                                        boolean isHorizontal)
Splits an image into count subimages.


toBufferedImage

public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)

toBufferedImage

public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image,
                                                           java.awt.Image icon)

toBufferedImage

public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image borderImage,
                                                           java.awt.Image bgImage,
                                                           java.awt.Image imageIcon)

hasAlpha

public static boolean hasAlpha(java.awt.Image image)
This method returns true if the specified image has transparent pixels Code taken from the Java Developers Almanac 1.4 http://javaalmanac.com/egs/java.awt.image/HasAlpha.html


mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

setDate

public void setDate(java.util.Date date)

getTimeFormatToString

public java.lang.String getTimeFormatToString()

setTimeFormatToString

public void setTimeFormatToString(java.lang.String time)

start

public void start()

stop

public void stop()

run

public void run()
Specified by:
run in interface java.lang.Runnable