javamorph
Class CPopupMenuDecorator

java.lang.Object
  extended by javamorph.CPopupMenuDecorator
All Implemented Interfaces:
ActionListener, MouseListener, EventListener, IDecorator

public class CPopupMenuDecorator
extends Object
implements IDecorator, MouseListener, ActionListener

Version:
1.1
Author:
claus.erhard.wimmer@googlemail.com
Program: JavaMorph V 1.1.
Class: CPopupMenuDecorator.
License: GPLv2.
Description: Handles the user's pop up menu.
Hint: Draw the hint symbol & process the menu commands.

Field Summary
static Color BUTTON
          One of the colors of the mouse symbol (buttons).
static Color CABLE
          One of the colors of the mouse symbol.
static Color FRAME
          One of the colors of the mouse symbol (border line).
private  ButtonGroup g_mesh_buttons
          Group of the mesh sub menu radio buttons.
private  ButtonGroup g_polygon_buttons
           
private  ButtonGroup g_radio_buttons
          Radio button group a) edit mesh b) edit polygon.
private  JMenuItem m_about
          Show about box command.
private  JRadioButtonMenuItem m_add_mesh_points
          Add mesh points command.
private  JRadioButtonMenuItem m_add_polygon_points
          Add polygon points command.
private  JMenuItem m_delete_mesh
          Delete whole mesh command.
private  JMenuItem m_delete_polygon
          Delete the whole polygon command.
private  JMenuItem m_edit_config
          Edit configuration command.
private  JRadioButtonMenuItem m_edit_mesh
          Edit mesh command.
private  JRadioButtonMenuItem m_edit_polygon
          Edit polygon command.
private  JMenuItem m_morph
          Morph command.
private  JRadioButtonMenuItem m_off_mesh_points
          Move mesh points command.
private  JRadioButtonMenuItem m_off_polygon_points
          Move polygon points command.
private  JRadioButtonMenuItem m_sub_mesh_points
          Remove mesh points command.
private  JRadioButtonMenuItem m_sub_polygon_points
          Remove polygon points command.
private  JMenu mesh_menu
          Sub menu, edit medh points.
static Color MOUSE
          One of the colors of the mouse symbol (area).
private  CFrame parent
          Parent JComponent to draw the mouse symbol to.
private  JMenu polygon_menu
          Sub menu, edit polygon points.
private  JPopupMenu popup_menu
          Pop up menu object with application control commands.
 
Constructor Summary
CPopupMenuDecorator(CFrame parent)
          Constructor.
 
Method Summary
 void actionPerformed(ActionEvent e)
          The user has entered a menu command by clicking the menu item.
 void mouseClicked(MouseEvent e)
          The user wants to see the pop up menu.
 void mouseEntered(MouseEvent e)
          Due to the event API.
 void mouseExited(MouseEvent e)
          Due to the event API.
 void mousePressed(MouseEvent e)
          Due to the event API.
 void mouseReleased(MouseEvent e)
          Due to the event API.
 void paint(Graphics g)
          Draw the mouse symbol to the graphics context of the parent JComponent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MOUSE

public static final Color MOUSE
One of the colors of the mouse symbol (area).


BUTTON

public static final Color BUTTON
One of the colors of the mouse symbol (buttons).


FRAME

public static final Color FRAME
One of the colors of the mouse symbol (border line).


CABLE

public static final Color CABLE
One of the colors of the mouse symbol. (connection cable fragment)


parent

private CFrame parent
Parent JComponent to draw the mouse symbol to.


popup_menu

private JPopupMenu popup_menu
Pop up menu object with application control commands.


mesh_menu

private JMenu mesh_menu
Sub menu, edit medh points.


m_add_mesh_points

private JRadioButtonMenuItem m_add_mesh_points
Add mesh points command.


m_sub_mesh_points

private JRadioButtonMenuItem m_sub_mesh_points
Remove mesh points command.


m_off_mesh_points

private JRadioButtonMenuItem m_off_mesh_points
Move mesh points command.


m_delete_mesh

private JMenuItem m_delete_mesh
Delete whole mesh command.


polygon_menu

private JMenu polygon_menu
Sub menu, edit polygon points.


m_add_polygon_points

private JRadioButtonMenuItem m_add_polygon_points
Add polygon points command.


m_sub_polygon_points

private JRadioButtonMenuItem m_sub_polygon_points
Remove polygon points command.


m_off_polygon_points

private JRadioButtonMenuItem m_off_polygon_points
Move polygon points command.


m_delete_polygon

private JMenuItem m_delete_polygon
Delete the whole polygon command.


g_radio_buttons

private ButtonGroup g_radio_buttons
Radio button group a) edit mesh b) edit polygon.


g_mesh_buttons

private ButtonGroup g_mesh_buttons
Group of the mesh sub menu radio buttons.


g_polygon_buttons

private ButtonGroup g_polygon_buttons

m_morph

private JMenuItem m_morph
Morph command.


m_edit_mesh

private JRadioButtonMenuItem m_edit_mesh
Edit mesh command.


m_edit_polygon

private JRadioButtonMenuItem m_edit_polygon
Edit polygon command.


m_edit_config

private JMenuItem m_edit_config
Edit configuration command.


m_about

private JMenuItem m_about
Show about box command.

Constructor Detail

CPopupMenuDecorator

public CPopupMenuDecorator(CFrame parent)
Constructor.

Parameters:
parent - The parent JComponent to draw the mouse symbol to.
Method Detail

paint

public void paint(Graphics g)
Draw the mouse symbol to the graphics context of the parent JComponent.

Specified by:
paint in interface IDecorator
Parameters:
g - Graphics context of the JComponent.

mouseClicked

public void mouseClicked(MouseEvent e)
The user wants to see the pop up menu.

Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Due to the event API.

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Due to the event API.

Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Due to the event API.

Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Due to the event API.

Specified by:
mouseReleased in interface MouseListener

actionPerformed

public void actionPerformed(ActionEvent e)
The user has entered a menu command by clicking the menu item.

Specified by:
actionPerformed in interface ActionListener