javax.swing.JTabbedPane.getClientProperty()方法的使用及代码示例

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

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

JTabbedPane.getClientProperty介绍

暂无

代码示例

代码示例来源:origin: net.java.dev.laf-widget/laf-widget

/**
 * Returns the preview painter for the specified tabbed pane.
 * 
 * @param tabbedPane
 *            Tabbed pane.
 * @return Preview painter for the specified tabbed pane.
 */
public static TabPreviewPainter getTabPreviewPainter(JTabbedPane tabbedPane) {
  if (tabbedPane == null)
    return null;
  // check property on tabbed pane
  Object tabProp = tabbedPane
      .getClientProperty(LafWidget.TABBED_PANE_PREVIEW_PAINTER);
  if (tabProp instanceof TabPreviewPainter)
    return (TabPreviewPainter) tabProp;
  return null;
}

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Extension point to allow horizontal orientation of left / right placed
 * tabs.
 * 
 * @param tabPlacement
 *            Tab placement.
 * @return Indication whether the tabs in the specified placement should be
 *         rotated.
 */
protected boolean toRotateTabsOnPlacement(int tabPlacement) {
  Object rotateProperty = tabPane.getClientProperty(SubstanceLookAndFeel.TABBED_PANE_ROTATE_SIDE_TABS);
  if (!(rotateProperty instanceof Boolean)) {
    rotateProperty = UIManager.get(SubstanceLookAndFeel.TABBED_PANE_ROTATE_SIDE_TABS);
  }
  boolean rotate = (rotateProperty instanceof Boolean) ? (Boolean)rotateProperty : true;
  return  rotate && ( (tabPlacement == SwingConstants.LEFT) || (tabPlacement == SwingConstants.RIGHT) );
}

代码示例来源:origin: org.java.net.substance/substance

/**
 * Returns the content border kind of the specified tabbed pane.
 * 
 * @param tabbedPane
 *            Tabbed pane.
 * @return Content border kind of the specified tabbed pane.
 * @see SubstanceLookAndFeel#TABBED_PANE_CONTENT_BORDER_KIND
 */
public static TabContentPaneBorderKind getContentBorderKind(
    JTabbedPane tabbedPane) {
  // check property on tabbed pane
  Object tabProp = tabbedPane
      .getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND);
  if (tabProp instanceof TabContentPaneBorderKind)
    return (TabContentPaneBorderKind) tabProp;
  // check property in UIManager
  Object globalProp = UIManager
      .get(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND);
  if (globalProp instanceof TabContentPaneBorderKind)
    return (TabContentPaneBorderKind) globalProp;
  return TabContentPaneBorderKind.DOUBLE_FULL;
}

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Returns the content border kind of the specified tabbed pane.
 * 
 * @param tabbedPane
 *            Tabbed pane.
 * @return Content border kind of the specified tabbed pane.
 * @see SubstanceLookAndFeel#TABBED_PANE_CONTENT_BORDER_KIND
 */
public static TabContentPaneBorderKind getContentBorderKind(
    JTabbedPane tabbedPane) {
  // check property on tabbed pane
  Object tabProp = tabbedPane
      .getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND);
  if (tabProp instanceof TabContentPaneBorderKind)
    return (TabContentPaneBorderKind) tabProp;
  // check property in UIManager
  Object globalProp = UIManager
      .get(SubstanceLookAndFeel.TABBED_PANE_CONTENT_BORDER_KIND);
  if (globalProp instanceof TabContentPaneBorderKind)
    return (TabContentPaneBorderKind) globalProp;
  return TabContentPaneBorderKind.DOUBLE_FULL;
}

代码示例来源:origin: stackoverflow.com

private static final OLD_TAB_INDEX_PROPERTY = "oldTabIdx";

tabbedPane.addChangeListener(new ChangeListener() {
 public void stateChanged(ChangeEvent e) {
  JTabbedPane tabP = (JTabbedPane) e.getSource();
  int currIndex = tabP.getSelectedIndex();

  int oldIdx = 0;
  Object old = tabP.getClientProperty(OLD_TAB_INDEX_PROPERTY);
  if (old instanceof Integer) {
   oldIdx = (Integer) old;
  }
  tabP.putClientProperty(OLD_TAB_INDEX_PROPERTY, currIndex);
  // now we can use old and current index
 }
});

代码示例来源:origin: com.github.arnabk/pgslookandfeel

/**
 * This method is a hack or workaround for Jython...
 */
private boolean checkBooleanClientProperty(Object key) {
  Object o = tabPane.getClientProperty(key);
  if (o == null) {
    return false;
  }
  if (o instanceof Boolean) {
    return ((Boolean) o).booleanValue();
  }
  // Wow. That's unexpected...
  if (o instanceof Integer) {
    // Jython seems to use Integers instead of booleans,
    // as we know it, let's be compatible to it.
    return ((Integer) o).intValue() != 0;
  }
  // Well... we know the property has been set, but
  // it seems like the user used wrong input. We just write out something
  // and return true.
  logger.warning(
      "It seems like you've used a wrong type for '" + key + "'. It should be a boolean, but is a " + o
          .getClass().getName());
  return true;
}

代码示例来源:origin: net.sf.squirrel-sql/squirrel-sql

public void stateChanged(ChangeEvent evt)
  {
    final Object src = evt.getSource();
    if (!(src instanceof JTabbedPane))
    {
      StringBuilder buf = new StringBuilder();
      buf.append("Source object in TabbedPaneListener was not a JTabbedpane")
        .append(" - it was ")
        .append(src == null ? "null" : src.getClass().getName());
      s_log.error(buf.toString());
      return;
    }
    JTabbedPane tabPane = (JTabbedPane)src;
    Object prop = tabPane.getClientProperty(ObjectTreeTabbedPane.IClientPropertiesKeys.TABBED_PANE_OBJ);
    if (!(prop instanceof ObjectTreeTabbedPane))
    {
      StringBuilder buf = new StringBuilder();
      buf.append("Client property in JTabbedPane was not an ObjectTreeTabbedPane")
        .append(" - it was ")
        .append(prop == null ? "null" : prop.getClass().getName());
      s_log.error(buf.toString());
      return;
    }
    ((ObjectTreeTabbedPane)prop).selectCurrentTab();
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void componentRemoved(ContainerEvent e) {
    JTabbedPane tp = (JTabbedPane) e.getContainer();
    Component child = e.getChild();
    if (child instanceof UIResource) {
      return;
    }
    // NOTE 4/15/2002 (joutwate):
    // This fix is implemented using client properties since there is
    // currently no IndexPropertyChangeEvent.  Once
    // IndexPropertyChangeEvents have been added this code should be
    // modified to use it.
    Integer indexObj = (Integer) tp.getClientProperty("__index_to_remove__");
    if (indexObj != null) {
      int index = indexObj.intValue();
      if (htmlViews != null && htmlViews.size() >= index) {
        htmlViews.remove(index);
      }
    }
  }
}

代码示例来源:origin: realXuJiang/bigtable-sql

public void stateChanged(ChangeEvent evt)
  {
    final Object src = evt.getSource();
    if (!(src instanceof JTabbedPane))
    {
      StringBuilder buf = new StringBuilder();
      buf.append("Source object in TabbedPaneListener was not a JTabbedpane")
        .append(" - it was ")
        .append(src == null ? "null" : src.getClass().getName());
      s_log.error(buf.toString());
      return;
    }
    JTabbedPane tabPane = (JTabbedPane)src;
    Object prop = tabPane.getClientProperty(ObjectTreeTabbedPane.IClientPropertiesKeys.TABBED_PANE_OBJ);
    if (!(prop instanceof ObjectTreeTabbedPane))
    {
      StringBuilder buf = new StringBuilder();
      buf.append("Client property in JTabbedPane was not an ObjectTreeTabbedPane")
        .append(" - it was ")
        .append(prop == null ? "null" : prop.getClass().getName());
      s_log.error(buf.toString());
      return;
    }
    ((ObjectTreeTabbedPane)prop).selectCurrentTab();
  }
}

代码示例来源:origin: org.java.net.substance/substance

.getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CLOSE_CALLBACK);
if (tabProp instanceof TabCloseCallback)
  return (TabCloseCallback) tabProp;

代码示例来源:origin: com.github.insubstantial/substance

.getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CLOSE_BUTTONS_PROPERTY);
if (Boolean.TRUE.equals(tabProp))
  return true;

代码示例来源:origin: com.github.insubstantial/substance

.getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CLOSE_BUTTONS_MODIFIED_ANIMATION);
if (Boolean.TRUE.equals(tabProp))
  return true;

代码示例来源:origin: com.github.insubstantial/substance

.getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CLOSE_CALLBACK);
if (tabProp instanceof TabCloseCallback)
  return (TabCloseCallback) tabProp;

代码示例来源:origin: org.java.net.substance/substance

.getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CLOSE_BUTTONS_PROPERTY);
if (Boolean.TRUE.equals(tabProp))
  return true;

代码示例来源:origin: org.java.net.substance/substance

.getClientProperty(SubstanceLookAndFeel.TABBED_PANE_CLOSE_BUTTONS_MODIFIED_ANIMATION);
if (Boolean.TRUE.equals(tabProp))
  return true;

代码示例来源:origin: net.sf.cuf/cuf-swing

Map         tabMapping= (Map) tabbedPane.getClientProperty(SwingXMLBuilder.TABMAPPING_PROPERTY);
String      widgetName= currentComponent.getName();
if ((tabMapping != null) && tabMapping.containsKey(widgetName))

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

boolean paintBorder = tabPane.getClientProperty("Palette.TabbedPane.paintContentBorder") != Boolean.FALSE;

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

Object o = c.getClientProperty("JTabbedPane.closeButton");
o = c.getClientProperty("JTabbedPane.closeListener");
if (o != null && o instanceof SeaGlassTabCloseListener) {
  if (tabCloseListener == null) {

代码示例来源:origin: net.sf.cuf/cuf-swing

.getClientProperty(SwingXMLBuilder.TABMAPPING_PROPERTY);
if (tabMapping == null)

相关文章

JTabbedPane类方法