Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ch.laoe.plugin
Class GPlugin  view GPlugin download GPlugin.java

java.lang.Object
  extended bych.laoe.plugin.GPlugin
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener
Direct Known Subclasses:
GPCopy, GPCopyMask, GPCopySelection, GPCut, GPDuplicate, GPFileClose, GPFileExit, GPFileOpen, GPFileSave, GPFileSaveAs, GPImageSaveAs, GPluginFrame, GPMove, GPPaste, GPPasteInsert, GPPasteIntoNew, GPPasteMask, GPPasteReplace, GPPasteSelection, GPRedo, GPSelectAfter, GPSelectBefore, GPSelectLayer, GPSplitToNew, GPUndo, GPUnmaskLayer, GPUnselectLayer

public abstract class GPlugin
extends java.lang.Object
implements java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

This file is part of LAoE. LAoE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. LAoE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LAoE; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Class: GPlugin Autor: olivier gäumann, neuchâtel (switzerland) JDK: 1.3 Desctription: parent class of all plugins. History: Date: Description: Autor: 30.08.00 erster Entwurf oli4 28.03.01 set focussed plugin individually oli4


Field Summary
private  javax.swing.ImageIcon icon
           
protected  ch.laoe.ui.GPersistance persistance
           
protected  GPluginHandler pluginHandler
           
 
Constructor Summary
GPlugin(GPluginHandler ph)
          constructor
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          called from created button or menu-item
protected  void autoScaleFocussedClip()
           
 javax.swing.JButton createButton()
           
protected  javax.swing.JButton createButton(java.lang.String iconName, java.lang.String toolTip)
          helps the children to create their buttons
protected  java.awt.Cursor createCustomCursor(java.lang.String cursorName)
           
 javax.swing.JMenuItem createMenuItem()
           
 javax.swing.JMenuItem createMenuItem(int key)
           
protected  javax.swing.JMenuItem createMenuItem(java.lang.String iconName, java.lang.String text, int key)
          helps the children to create their menuitems.
protected  java.lang.String getDescription()
          returns the name of the plugin and a short description.
protected  ch.laoe.clip.AClip getFocussedClip()
           
protected  ch.laoe.ui.GClipEditor getFocussedClipEditor()
           
protected  ch.laoe.ui.GClipFrame getFocussedClipFrame()
           
protected static java.lang.String getLaoeInstallationPath()
           
protected  ch.laoe.ui.GMain getMain()
           
protected abstract  java.lang.String getName()
          returns the normal one-word name of the plugin.
protected  ch.laoe.clip.ALayer getSelectedLayer()
           
protected static boolean isAltKey(java.awt.event.MouseEvent e)
           
protected static boolean isButton1(java.awt.event.MouseEvent e)
           
protected static boolean isButton2(java.awt.event.MouseEvent e)
           
protected static boolean isButton3(java.awt.event.MouseEvent e)
           
protected static boolean isCtrlKey(java.awt.event.MouseEvent e)
           
protected static boolean isShiftKey(java.awt.event.MouseEvent e)
           
 boolean isVisible()
           
protected  javax.swing.ImageIcon loadIcon()
           
protected  javax.swing.ImageIcon loadIcon(java.lang.String iconName)
           
 void mouseClicked(java.awt.event.MouseEvent e)
          This method is called when the mouse is clicked (pressed and released in short succession) on a component.
 void mouseDragged(java.awt.event.MouseEvent e)
          This method is called when the mouse is moved over a component while a button has been pressed.
 void mouseEntered(java.awt.event.MouseEvent e)
          This method is called when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          This method is called when the mouse exits a component.
 void mouseMoved(java.awt.event.MouseEvent e)
          This method is called when the mouse is moved over a component while no button is pressed.
 void mousePressed(java.awt.event.MouseEvent e)
          This method is called when the mouse is pressed over a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          This method is called when the mouse is released over a component.
 void onBackup(UiPersistanceEvent e)
           
 void onRestore(UiPersistanceEvent e)
          do not use "on restore", each class is responsible of its own restoring, e.g.
 void paintOntoClip(java.awt.Graphics2D g2d, java.awt.Rectangle rect)
          called by ui when this plugin needs to print onto the clip
 void reload()
          called by ui if a plugin should reload its values
protected  void reloadFocussedClipEditor()
           
protected  void repaintFocussedClipEditor()
           
protected  void setPluginHandler(GPluginHandler ph)
           
 void start()
          called when this plugin gets active and focussed
protected  void updateFrameTitle()
           
protected  void updateHistory(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pluginHandler

protected GPluginHandler pluginHandler

persistance

protected ch.laoe.ui.GPersistance persistance

icon

private javax.swing.ImageIcon icon
Constructor Detail

GPlugin

public GPlugin(GPluginHandler ph)
constructor

Method Detail

getName

protected abstract java.lang.String getName()
returns the normal one-word name of the plugin.


getDescription

protected final java.lang.String getDescription()
returns the name of the plugin and a short description. the format has no restriction, typically html format is used. if not used, return the one-word name of the plugin.


setPluginHandler

protected void setPluginHandler(GPluginHandler ph)

isVisible

public boolean isVisible()

getFocussedClip

protected ch.laoe.clip.AClip getFocussedClip()

getSelectedLayer

protected ch.laoe.clip.ALayer getSelectedLayer()

getFocussedClipEditor

protected ch.laoe.ui.GClipEditor getFocussedClipEditor()

getFocussedClipFrame

protected ch.laoe.ui.GClipFrame getFocussedClipFrame()

autoScaleFocussedClip

protected void autoScaleFocussedClip()

repaintFocussedClipEditor

protected final void repaintFocussedClipEditor()

reloadFocussedClipEditor

protected final void reloadFocussedClipEditor()

updateHistory

protected void updateHistory(java.lang.String s)

updateFrameTitle

protected void updateFrameTitle()

getMain

protected ch.laoe.ui.GMain getMain()

loadIcon

protected javax.swing.ImageIcon loadIcon(java.lang.String iconName)

loadIcon

protected javax.swing.ImageIcon loadIcon()

createButton

protected javax.swing.JButton createButton(java.lang.String iconName,
                                           java.lang.String toolTip)
helps the children to create their buttons


createButton

public javax.swing.JButton createButton()

createMenuItem

protected javax.swing.JMenuItem createMenuItem(java.lang.String iconName,
                                               java.lang.String text,
                                               int key)
helps the children to create their menuitems. if no icon should be used, set it to null. if no key accelerator should be used, set it to 0.


createMenuItem

public javax.swing.JMenuItem createMenuItem()

createMenuItem

public javax.swing.JMenuItem createMenuItem(int key)

start

public void start()
called when this plugin gets active and focussed


reload

public void reload()
called by ui if a plugin should reload its values


paintOntoClip

public void paintOntoClip(java.awt.Graphics2D g2d,
                          java.awt.Rectangle rect)
called by ui when this plugin needs to print onto the clip


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is clicked (pressed and released in short succession) on a component.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is pressed over a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseListener
This method is called when the mouse is released over a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseMotionListener
This method is called when the mouse is moved over a component while no button is pressed.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Description copied from interface: java.awt.event.MouseMotionListener
This method is called when the mouse is moved over a component while a button has been pressed.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

createCustomCursor

protected java.awt.Cursor createCustomCursor(java.lang.String cursorName)

onRestore

public final void onRestore(UiPersistanceEvent e)
do not use "on restore", each class is responsible of its own restoring, e.g. at construction time.


onBackup

public void onBackup(UiPersistanceEvent e)

actionPerformed

public final void actionPerformed(java.awt.event.ActionEvent e)
called from created button or menu-item

Specified by:
actionPerformed in interface java.awt.event.ActionListener

isShiftKey

protected static boolean isShiftKey(java.awt.event.MouseEvent e)

isCtrlKey

protected static boolean isCtrlKey(java.awt.event.MouseEvent e)

isAltKey

protected static boolean isAltKey(java.awt.event.MouseEvent e)

isButton1

protected static boolean isButton1(java.awt.event.MouseEvent e)

isButton2

protected static boolean isButton2(java.awt.event.MouseEvent e)

isButton3

protected static boolean isButton3(java.awt.event.MouseEvent e)

getLaoeInstallationPath

protected static java.lang.String getLaoeInstallationPath()