javax.swing.JComponent.isEnabled()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(153)

本文整理了Java中javax.swing.JComponent.isEnabled()方法的一些代码示例,展示了JComponent.isEnabled()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.isEnabled()方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:isEnabled

JComponent.isEnabled介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-awt

/** Generic code to set properties appropriately from any of the renderer
 * fetching methods */
private void configureFrom(Object value, JComponent target, boolean selected, boolean leadSelection) {
  if (value == null) {
    value = "";
  }
  setText((value == null) ? "" : value.toString());
  setSelected(selected);
  if (selected) {
    setParentFocused(checkFocused(target));
  } else {
    setParentFocused(false);
  }
  setEnabled(target.isEnabled());
  setLeadSelection(leadSelection);
  setFont(target.getFont());
}

代码示例来源:origin: xyz.cofe/docking-frames-core

/**
 * Tells whether this model reacts on mouse-clicks or not.
 * @return the property
 */
public boolean isEnabled() {
  return owner.isEnabled();
}

代码示例来源:origin: org.gephi/datalab-api

@Override
  public boolean isOkButtonEnabled() {
    return okButton.isEnabled();
  }
}

代码示例来源:origin: com.atlassian.jira/jira-configurator

@Override
public boolean isUsingDefault()
{
  return !component.isEnabled();
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

public static int getComponentState(JComponent c) {
  if (c.isEnabled()) {
    if (c.isFocusOwner()) {
      return SynthConstants.ENABLED | SynthConstants.FOCUSED;
    }
    return SynthConstants.ENABLED;
  }
  return SynthConstants.DISABLED;
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
  protected void updateEnabled() {
    if (target != null) {
      setEnabled(target.isEnabled());
    }
  }
}

代码示例来源:origin: org.ihtsdo/wb-api

public boolean canImport(JComponent c, DataFlavor[] flavors ){
  if (c.isEnabled()) { 
    if (hasConceptBeanFlavor(flavors,conceptBeanFlavor )) {
      return true;
    }
  }
  return false;
}
private boolean hasConceptBeanFlavor(DataFlavor[] flavors,DataFlavor conceptBeanFlavor) {

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

public static int getComponentState(JComponent c) {
  if (c.isEnabled()) {
    if (c.isFocusOwner()) {
      return SynthConstants.ENABLED | SynthConstants.FOCUSED;
    }
    return SynthConstants.ENABLED;
  }
  return SynthConstants.DISABLED;
}

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

@Override
  protected void updateEnabled() {
    if (target != null) {
      setEnabled(target.isEnabled());
    }
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

public static int getComponentState(JComponent c) {
  if (c.isEnabled()) {
    if (c.isFocusOwner()) {
      return SynthConstants.ENABLED | SynthConstants.FOCUSED;
    }
    return SynthConstants.ENABLED;
  }
  return SynthConstants.DISABLED;
}

代码示例来源:origin: com.synaptix/SynaptixSwing

@Override
  public void mouseClicked(MouseEvent e) {
    if ((e.getClickCount() == 2) && (e.getButton() == MouseEvent.BUTTON3)) {
      if (getComponent().isEnabled()) {
        setValue(null);
      }
    }
  }
});

代码示例来源:origin: org.opentcs.thirdparty.jhotdraw/jhotdraw

protected void updateEnabled() {
    if (target instanceof EditableComponent) {
      setEnabled(target.isEnabled() && !((EditableComponent) target).isSelectionEmpty());
    } else if (target != null) {
      setEnabled(target.isEnabled());
    }
  }
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-core

public static boolean shouldIgnore(MouseEvent mouseEvent,
    JComponent component) {
  return ((component == null) || (!(component.isEnabled()))
      || (!(SwingUtilities.isLeftMouseButton(mouseEvent))) 
      || (mouseEvent.isConsumed()));
}

代码示例来源:origin: khuxtable/seaglass

private int getComponentState(JComponent c, Region region) {
  if (region == Region.SLIDER_THUMB && thumbActive && c.isEnabled()) {
    int state = thumbPressed ? PRESSED : MOUSE_OVER;
    if (c.isFocusOwner()) state |= FOCUSED;
    return state;
  }
  return SeaGlassLookAndFeel.getComponentState(c);
}

代码示例来源:origin: khuxtable/seaglass

private int getComponentState(JComponent c) {
  JComponent comp = ((JToolTip) c).getComponent();
  if (comp != null && !comp.isEnabled()) {
    return DISABLED;
  }
  return SeaGlassLookAndFeel.getComponentState(c);
}

代码示例来源:origin: gurkenlabs/litiengine

@Override
 public void mousePressed(MouseEvent e) {
  super.mousePressed(e);
  if (button.isEnabled()) {
   button.requestFocus();
  }
 }
});

代码示例来源:origin: com.haulmont.thirdparty/swingx-core

public static boolean shouldIgnore(MouseEvent mouseEvent,
    JComponent component) {
  return ((component == null) || (!(component.isEnabled()))
      || (!(SwingUtilities.isLeftMouseButton(mouseEvent))) 
      || (mouseEvent.isConsumed()));
}

代码示例来源:origin: org.swinglabs.swingx/swingx-core

@Override
  public boolean isEnabled(Object sender) {
    if (component == null || !component.isEnabled() || !component.hasFocus())
      return false;
    return isClickable(getFocusedCell());
  }
};

代码示例来源:origin: org.swinglabs.swingx/swingx-all

@Override
  public boolean isEnabled(Object sender) {
    if (component == null || !component.isEnabled() || !component.hasFocus())
      return false;
    return isClickable(getFocusedCell());
  }
};

代码示例来源:origin: com.metsci.glimpse/glimpse-wizard

protected void copySettings( JComponent from, JComponent to )
{
  to.setForeground( from.getForeground( ) );
  to.setBackground( from.getBackground( ) );
  to.setEnabled( from.isEnabled( ) );
  to.setFont( from.getFont( ) );
  to.setOpaque( from.isOpaque( ) );
}

相关文章

JComponent类方法