1 package org.jacorb.poa.gui.beans; 2 3 22 23 29 public class PopupMenu 30 extends java.awt.PopupMenu 31 { 32 private java.awt.Component fieldOwnerComponent = null; 33 protected transient java.beans.PropertyChangeSupport propertyChange = 34 new java.beans.PropertyChangeSupport (this); 35 36 39 public PopupMenu() { 40 super(); 41 initialize(); 42 } 43 47 public PopupMenu(java.lang.String label) { 48 super(label); 49 } 50 54 public void _show(java.awt.Component c, int x, int y) { 55 if (c != null) { 56 setOwnerComponent(c); 57 c.add(this); 58 show(c, x, y); 59 } 60 } 61 65 public void _show(java.awt.event.MouseEvent mouseEvent) { 66 java.awt.Component popupOwner = mouseEvent.getComponent(); 68 if (popupOwner != null) { 69 setOwnerComponent(popupOwner); 70 popupOwner.add(this); 71 show(popupOwner, mouseEvent.getX(), mouseEvent.getY()); 72 } 73 } 75 78 public synchronized void addPropertyChangeListener(java.beans.PropertyChangeListener listener) { 79 propertyChange.addPropertyChangeListener(listener); 80 } 81 84 public void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue) { 85 propertyChange.firePropertyChange(propertyName, oldValue, newValue); 86 } 87 92 public java.awt.Component getOwnerComponent() { 93 94 return fieldOwnerComponent; 95 } 96 100 private void handleException(Throwable exception) { 101 102 103 } 106 109 110 private void initialize() { 111 } 116 120 public static void main(java.lang.String [] args) { 121 try { 122 org.jacorb.poa.gui.beans.PopupMenu aExtendedPopupMenu = 123 new org.jacorb.poa.gui.beans.PopupMenu(); 124 } catch (Throwable exception) { 125 System.err.println("Exception occurred in main() of org.jacorb.poa.gui.beans.PopupMenu"); 126 exception.printStackTrace(System.out); 127 } 128 } 129 132 public synchronized void removePropertyChangeListener(java.beans.PropertyChangeListener listener) { 133 propertyChange.removePropertyChangeListener(listener); 134 } 135 140 public void setOwnerComponent(java.awt.Component ownerComponent) { 141 142 java.awt.Component oldValue = fieldOwnerComponent; 143 144 fieldOwnerComponent = ownerComponent; 145 146 firePropertyChange("ownerComponent", oldValue, ownerComponent); 147 return; 148 } 149 150 } 151 152 153 154 155 156 157 158 159 160 161 162 163 | Popular Tags |