當前位置: 首頁>>代碼示例>>Java>>正文


Java HierarchyListener類代碼示例

本文整理匯總了Java中java.awt.event.HierarchyListener的典型用法代碼示例。如果您正苦於以下問題:Java HierarchyListener類的具體用法?Java HierarchyListener怎麽用?Java HierarchyListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


HierarchyListener類屬於java.awt.event包,在下文中一共展示了HierarchyListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: QueryUI

import java.awt.event.HierarchyListener; //導入依賴的package包/類
public QueryUI(OQLController.QueryController queryController, OQLEngine engine) {
    super(Bundle.OQLControllerUI_QueryEditorCaption(), ICON, true);

    this.queryController = queryController;

    initComponents(engine);
    
    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                if (isShowing()) {
                    updateUIState();
                    QueryUI.this.removeHierarchyListener(this);
                }
            }
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:OQLControllerUI.java

示例2: InstanceScrollPane

import java.awt.event.HierarchyListener; //導入依賴的package包/類
InstanceScrollPane(Heap heap) {
    this.heap = heap;
    
    setBorder(BorderFactory.createEmptyBorder());
    setViewportBorder(BorderFactory.createLineBorder(
            UIManager.getLookAndFeel().getID().equals("Metal") ? // NOI18N
            UIManager.getColor("Button.darkShadow") : // NOI18N
            UIManager.getColor("Button.shadow"))); // NOI18N
    
    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                if (instancePending && isShowing()) showInstanceImpl();
            }
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:18,代碼來源:InstancesListControllerUI.java

示例3: JTreeTablePanel

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/** Creates a new instance of JTreeTablePanel */
public JTreeTablePanel(JTreeTable treeTable) {
    super(new BorderLayout());
    this.treeTable = treeTable;

    initComponents();
    hookHeaderColumnResize();
    hookScrollBarValueChange();
    hookTreeCollapsedExpanded();

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
                if (isShowing()) {
                    updateScrollBar(true);
                }
            }
        }
    });
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:21,代碼來源:JTreeTablePanel.java

示例4: addTo

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/**
 * Expects to be added to a SymbolDice. Adds the button to the control window's toolbar and registers itself as a
 * {@link KeyStrokeListener}
 */
public void addTo(Buildable parent) {
  resultsIcon.setResults(new int[dice.size()]);
  launch.addHierarchyListener(new HierarchyListener() {
    public void hierarchyChanged(HierarchyEvent e) {
      if (launch.isShowing()) {
        dialog.setLocationRelativeTo(launch);
        launch.removeHierarchyListener(this);
      }
    }
  });
  final GameModule mod = GameModule.getGameModule();
  ran = mod.getRNG();
  mod.getToolBar().add(launch);
  idMgr.add(this);
  mod.addCommandEncoder(this);
  property.addTo((MutablePropertiesContainer)parent);
}
 
開發者ID:ajmath,項目名稱:VASSAL-src,代碼行數:22,代碼來源:SpecialDiceButton.java

示例5: getContent

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/** Returns the main panel shown on this dialog. */
public GraphPreviewPanel getContent() {
    if (this.contentPanel == null) {
        this.contentPanel = new GraphPreviewPanel(getJGraph());
        this.contentPanel.initialise();
        this.contentPanel.setEnabled(true);
        // make any dialog in which this panel is embedded resizable
        // taken from https://blogs.oracle.com/scblog/entry/tip_making_joptionpane_dialog_resizable
        this.contentPanel.addHierarchyListener(new HierarchyListener() {
            @Override
            public void hierarchyChanged(HierarchyEvent e) {
                Window window =
                    SwingUtilities.getWindowAncestor(GraphPreviewDialog.this.contentPanel);
                if (window instanceof Dialog) {
                    Dialog dialog = (Dialog) window;
                    if (!dialog.isResizable()) {
                        dialog.setResizable(true);
                    }
                }
            }
        });
    }
    return this.contentPanel;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:25,代碼來源:GraphPreviewDialog.java

示例6: installListeners

import java.awt.event.HierarchyListener; //導入依賴的package包/類
@Override
protected void installListeners() {
    if (WindowsLookAndFeel.isOnVista()) {
        installWindowListener();
        hierarchyListener =
            new HierarchyListener() {
                public void hierarchyChanged(HierarchyEvent e) {
                    if ((e.getChangeFlags()
                            & HierarchyEvent.DISPLAYABILITY_CHANGED) != 0) {
                        if (menuBar.isDisplayable()) {
                            installWindowListener();
                        } else {
                            uninstallWindowListener();
                        }
                    }
                }
        };
        menuBar.addHierarchyListener(hierarchyListener);
    }
    super.installListeners();
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:22,代碼來源:WindowsMenuBarUI.java

示例7: PCanvas

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/**
 * Construct a canvas with the basic scene graph consisting of a root,
 * camera, and layer. Zooming and panning are automatically installed.
 */
public PCanvas() {
    CURRENT_ZCANVAS = this;
    cursorStack = new PStack();
    setCamera(createDefaultCamera());
    setDefaultRenderQuality(PPaintContext.HIGH_QUALITY_RENDERING);
    setAnimatingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setInteractingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setPanEventHandler(new PPanEventHandler());
    setZoomEventHandler(new PZoomEventHandler());
    setBackground(Color.WHITE);
    setOpaque(true);

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(final HierarchyEvent e) {
            if (e.getComponent() == PCanvas.this) {
                if (getParent() == null) {
                    removeInputSources();
                }
                else if (isEnabled()) {
                    installInputSources();
                }
            }
        }
    });
}
 
開發者ID:mleoking,項目名稱:PhET,代碼行數:30,代碼來源:PCanvas.java

示例8: BezierAnimationPanel

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/**
 * BezierAnimationPanel Constructor
 */
public BezierAnimationPanel() {
    setOpaque(true);

    colors.put(BACKGROUND, new Color(0, 0, 153));
    colors.put(OUTER, new Color(255, 255, 255));
    colors.put(GRADIENT_A, new Color(255, 0, 101));
    colors.put(GRADIENT_B, new Color(255, 255, 0));

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(HierarchyEvent e) {
            if (isShowing()) {
                start();
            } else {
                stop();
            }
        }
    }
    );
}
 
開發者ID:freeseawind,項目名稱:littleluck,代碼行數:23,代碼來源:BezierAnimationPanel.java

示例9: initUI

import java.awt.event.HierarchyListener; //導入依賴的package包/類
private void initUI() {
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    glassPane = new DisabledGlassPane();
    JRootPane rootPane = SwingUtilities.getRootPane(this);
    rootPane.setGlassPane(glassPane);

    final java.awt.Component topLevelGlassPane = DesktopComponentsHelper.getTopLevelFrame(parentContainer).getGlassPane();
    topLevelGlassPane.addHierarchyListener(new HierarchyListener() {
        @Override
        public void hierarchyChanged(HierarchyEvent e) {
            if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) == HierarchyEvent.SHOWING_CHANGED) {
                if (topLevelGlassPane.isVisible()) {
                    glassPane.activate(null);
                } else {
                    glassPane.deactivate();
                }
            }
        }
    });
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:21,代碼來源:DetachedFrame.java

示例10: addHierarchyListener

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/**
 * Adds the specified listener to this component. This is harmless if the
 * listener is null, but if the listener has already been registered, it
 * will now be registered twice.
 *
 * @param listener the new listener to add
 * @see HierarchyEvent
 * @see #removeHierarchyListener(HierarchyListener)
 * @see #getHierarchyListeners()
 * @since 1.3
 */
public synchronized void addHierarchyListener(HierarchyListener listener)
{
  if (listener != null)
    {
      hierarchyListener = AWTEventMulticaster.add(hierarchyListener,
                                                  listener);
      newEventsOnly = true;
      // Need to lock the tree, otherwise we might end up inconsistent.
      synchronized (getTreeLock())
      {
        numHierarchyListeners++;
        if (parent != null)
          parent.updateHierarchyListenerCount(AWTEvent.HIERARCHY_EVENT_MASK,
                                              1);
      }
    }
}
 
開發者ID:vilie,項目名稱:javify,代碼行數:29,代碼來源:Component.java

示例11: createComponents

import java.awt.event.HierarchyListener; //導入依賴的package包/類
private void createComponents() {
  final JScrollPane scrollPane = new JScrollPane(localPlayerPanel);
  localPlayerPanel.addHierarchyListener(new HierarchyListener() {
    @Override
    public void hierarchyChanged(final HierarchyEvent e) {
      final Window window = SwingUtilities.getWindowAncestor(localPlayerPanel);
      if (window instanceof Dialog) {
        final Dialog dialog = (Dialog) window;
        if (!dialog.isResizable()) {
          dialog.setResizable(true);
          dialog.setMinimumSize(new Dimension(700, 700));
        }
      }
    }
  });
  localPlayerSelection.addActionListener(
      e -> JOptionPane.showMessageDialog(PbemSetupPanel.this, scrollPane, "Select Local Players and AI's",
          JOptionPane.PLAIN_MESSAGE));
}
 
開發者ID:triplea-game,項目名稱:triplea,代碼行數:20,代碼來源:PbemSetupPanel.java

示例12: makeOwningDialogResizable

import java.awt.event.HierarchyListener; //導入依賴的package包/類
public static void makeOwningDialogResizable(@Nonnull final Component component, @Nonnull @MustNotContainNull final Runnable... extraActions) {
  final HierarchyListener listener = new HierarchyListener() {
    @Override
    public void hierarchyChanged(@Nonnull final HierarchyEvent e) {
      final Window window = SwingUtilities.getWindowAncestor(component);
      if (window instanceof Dialog) {
        final Dialog dialog = (Dialog) window;
        if (!dialog.isResizable()) {
          dialog.setResizable(true);
          component.removeHierarchyListener(this);

          for (final Runnable r : extraActions) {
            r.run();
          }
        }
      }
    }
  };
  component.addHierarchyListener(listener);
}
 
開發者ID:raydac,項目名稱:netbeans-mmd-plugin,代碼行數:21,代碼來源:UiUtils.java

示例13: createHierarchyListener

import java.awt.event.HierarchyListener; //導入依賴的package包/類
private final HierarchyListener createHierarchyListener()
{
	return new HierarchyListener()
	{

		@Override
		public void hierarchyChanged(HierarchyEvent e)
		{
			if (e.getChangeFlags() == HierarchyEvent.PARENT_CHANGED)
			{
				configureColumnControl();
			}
		}

	};
}
 
開發者ID:metasfresh,項目名稱:metasfresh,代碼行數:17,代碼來源:CTable.java

示例14: showPanel

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/** Displays the Tag panel. Returns true if the user canceled. */
protected boolean showPanel()
{
	isEmpty = true;

	panel.addHierarchyListener(new HierarchyListener() {
		@Override
		public void hierarchyChanged(HierarchyEvent e)
		{
			Window window = SwingUtilities.getWindowAncestor(panel);
			if (window instanceof Dialog)
			{
				Dialog dialog = (Dialog) window;
				if (!dialog.isResizable())
				{
					dialog.setResizable(true);
				}
			}
		}
	});
	boolean cancel = JOptionPane.showConfirmDialog(null, panel, Generator.translate("GUI:tag.add") + " : " + getName(), JOptionPane.OK_CANCEL_OPTION) != JOptionPane.OK_OPTION;
	if (!cancel) isEmpty = false;
	return cancel;
}
 
開發者ID:Cubiccl,項目名稱:CommandGenerator,代碼行數:25,代碼來源:Tag.java

示例15: PCanvas

import java.awt.event.HierarchyListener; //導入依賴的package包/類
/**
 * Construct a canvas with the basic scene graph consisting of a root,
 * camera, and layer. Zooming and panning are automatically installed.
 */
public PCanvas() {
    cursorStack = new PStack();
    setCamera(createDefaultCamera());
    setDefaultRenderQuality(PPaintContext.HIGH_QUALITY_RENDERING);
    setAnimatingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setInteractingRenderQuality(PPaintContext.LOW_QUALITY_RENDERING);
    setPanEventHandler(new PPanEventHandler());
    setZoomEventHandler(new PZoomEventHandler());
    setBackground(Color.WHITE);
    setOpaque(true);

    addHierarchyListener(new HierarchyListener() {
        public void hierarchyChanged(final HierarchyEvent e) {
            if (e.getComponent() == PCanvas.this) {
                if (getParent() == null) {
                    removeInputSources();
                }
                else if (isEnabled()) {
                    installInputSources();
                }
            }
        }
    });
}
 
開發者ID:piccolo2d,項目名稱:piccolo2d.java,代碼行數:29,代碼來源:PCanvas.java


注:本文中的java.awt.event.HierarchyListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。