Example usage for javax.swing JPopupMenu isShowing

List of usage examples for javax.swing JPopupMenu isShowing

Introduction

In this page you can find the example usage for javax.swing JPopupMenu isShowing.

Prototype

public boolean isShowing() 

Source Link

Document

Determines whether this component is showing on screen.

Usage

From source file:com.intel.stl.ui.common.view.JumpChartPanel.java

@Override
public void chartMouseMoved(ChartMouseEvent cme) {
    JPopupMenu popup = getPopupMenu();
    if (popup != null && popup.isShowing()) {
        return;/* w w w .j  ava 2s .c  om*/
    }

    ChartEntity xyItem = cme.getEntity();
    if (xyItem instanceof CategoryLabelEntity) {
        CategoryLabelEntity newCatEntity = (CategoryLabelEntity) xyItem;
        if (highlightedEntity != null && newCatEntity.getKey().equals(highlightedEntity.getKey())) {
            return;
        }

        if (highlightedEntity != null) {
            highlightEntity(highlightedEntity, false);
        }

        highlightedEntity = (CategoryLabelEntity) xyItem;
        if (categoryAxis == null) {
            CategoryPlot plot = getChart().getCategoryPlot();
            categoryAxis = plot.getDomainAxis();
        }
        highlightEntity(highlightedEntity, true);
        setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
    } else {
        if (highlightedEntity != null) {
            highlightEntity(highlightedEntity, false);
            highlightedEntity = null;
        }
        setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    }
}