当前位置: 首页>>代码示例>>Java>>正文


Java CompoundBorder.getInsideBorder方法代码示例

本文整理汇总了Java中javax.swing.border.CompoundBorder.getInsideBorder方法的典型用法代码示例。如果您正苦于以下问题:Java CompoundBorder.getInsideBorder方法的具体用法?Java CompoundBorder.getInsideBorder怎么用?Java CompoundBorder.getInsideBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.border.CompoundBorder的用法示例。


在下文中一共展示了CompoundBorder.getInsideBorder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBorderTitle

import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
/**
 * Recursivly searches a border hierarchy (starting at <code>border) for
 * a titled border and returns the title if one is found, <code>null</code>
 * otherwise.
 *
 * @param border the border to start search from
 *
 * @return the border title of a possibly found titled border
 */
protected String getBorderTitle(Border border)
{
  String title = null;
  if (border instanceof CompoundBorder)
    {
      CompoundBorder compound = (CompoundBorder) border;
      Border inner = compound.getInsideBorder();
      title = getBorderTitle(inner);
      if (title == null)
        {
          Border outer = compound.getOutsideBorder();
          title = getBorderTitle(outer);
        }
    }
  else if (border instanceof TitledBorder)
    {
      TitledBorder titled = (TitledBorder) border;
      title = titled.getTitle();
    }
  return title;
}
 
开发者ID:vilie,项目名称:javify,代码行数:31,代码来源:JComponent.java

示例2: getBorderTitle

import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
/**
 * Recursivly searches a border hierarchy (starting at <code>border) for
 * a titled border and returns the title if one is found, <code>null</code>
 * otherwise.
 *
 * @param border the border to start search from
 *
 * @return the border title of a possibly found titled border
 */
protected String getBorderTitle(Border border)
{
  String title = null;
  if (border instanceof CompoundBorder)
    {
      CompoundBorder compound = (CompoundBorder) border;
      Border inner = compound.getInsideBorder();
      title = getBorderTitle(inner);
      if (title == null)
        {
          Border outer = compound.getOutsideBorder();
          title = getBorderTitle(outer);
        }
    }
  else if (border instanceof TitledBorder)
    {
      TitledBorder titled = (TitledBorder) border;
      title = titled.getTitle(); 
    }
  return title;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:31,代码来源:JComponent.java

示例3: disableBorderTitles

import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
/**
 */
private static void disableBorderTitles(Border border) {
    
    if (border instanceof TitledBorder) {
        disableBorderTitle((TitledBorder) border);
        return;
    }
    
    if (!(border instanceof CompoundBorder)) {
        return;
    }
    
    Stack<CompoundBorder> stack = new Stack<CompoundBorder>();
    stack.push((CompoundBorder) border);
    while (!stack.empty()) {
        CompoundBorder cb = stack.pop();
        
        Border b;
        b = cb.getOutsideBorder();
        if (b instanceof CompoundBorder) {
            stack.push((CompoundBorder) b);
        } else if (b instanceof TitledBorder) {
            disableBorderTitle((TitledBorder) b);
        }
        
        b = cb.getInsideBorder();
        if (b instanceof CompoundBorder) {
            stack.push((CompoundBorder) b);
        } else if (b instanceof TitledBorder) {
            disableBorderTitle((TitledBorder) b);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:CommonTestsCfgOfCreate.java

示例4: setMargin

import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
public static void setMargin(final JComponent component, final Insets newMargin) {
    final Border currentBorder = component.getBorder();
    final Border empty = new EmptyBorder(newMargin.top, newMargin.left, newMargin.bottom, newMargin.right);
    if (currentBorder == null || currentBorder instanceof EmptyBorder) {
        component.setBorder(empty);
    } else if (currentBorder instanceof CompoundBorder) {
        final CompoundBorder current = (CompoundBorder) currentBorder;
        final Border insideBorder = current.getInsideBorder();
        component.setBorder(new CompoundBorder(empty, insideBorder));
    } else {
        component.setBorder(new CompoundBorder(empty, currentBorder));
    }
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:14,代码来源:SwingHelper.java

示例5: installAcceleratorPreview

import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
private static void installAcceleratorPreview(JMenuItem item) {
    if(item instanceof JMenu) return;
    //detect accelerator key
    boolean already_has_accel = false;
    if(item.getAccelerator() != null) already_has_accel = true;
    if(item.getAction() != null && item.getAction().getValue(Action.ACCELERATOR_KEY) != null) already_has_accel = true;

    
    
    boolean already_has_accel_border = false;
    if(item.getBorder() == accel_border) {
        already_has_accel_border = true;
        //uninstall if needed
        if(already_has_accel) {
            item.setBorder(null);
            return;
        }
    }
    
    if(item.getBorder() instanceof CompoundBorder) {
        CompoundBorder comp = (CompoundBorder)item.getBorder();
        if(comp.getInsideBorder() == accel_border) {
            already_has_accel_border = true;
            //uninstall if needed
            if(already_has_accel) {
                item.setBorder(comp.getOutsideBorder());
                return;
            }
        }
    }
    
    if(already_has_accel_border) return;
    if(already_has_accel) return;
    
    
    if(item.getBorder() == null) {
        item.setBorder(accel_border);
        return;
    }
    
    item.setBorder(BorderFactory.createCompoundBorder(
                item.getBorder(),accel_border));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:44,代码来源:MenuEditLayer.java

示例6: getRolloverMarginBorder

import javax.swing.border.CompoundBorder; //导入方法依赖的package包/类
private Border getRolloverMarginBorder() {
    JToggleButton button = new JToggleButton();
    CompoundBorder border = (CompoundBorder) getNonRolloverBorder(button);
    return border.getInsideBorder();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:6,代码来源:Test4856008.java


注:本文中的javax.swing.border.CompoundBorder.getInsideBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。