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


Java Paintable类代码示例

本文整理汇总了Java中gnu.kawa.models.Paintable的典型用法代码示例。如果您正苦于以下问题:Java Paintable类的具体用法?Java Paintable怎么用?Java Paintable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ReplEditorKit

import gnu.kawa.models.Paintable; //导入依赖的package包/类
public ReplEditorKit(final ReplPane pane)
{
  this.pane = pane;
  styledFactory = super.getViewFactory();
  factory = new ViewFactory ()
    {
      public View create(Element elem)
      {
        String kind = elem.getName();
        if (kind == ReplPane.ViewableElementName)
          {
            return (new ComponentView(elem)
              {
                @Override
                protected Component createComponent()
                {
                  AttributeSet attr = getElement().getAttributes();
                  JPanel panel = new JPanel();
                  Viewable v = (Viewable) attr.getAttribute(ReplPane.ViewableAttribute);
                  Component comp;
                  // A kludge: We create a panel, and then since all current
                  // Viewables just create a Component and put it in the
                  // panel, we get rid of the useless JPanel.
                  v.makeView(SwingDisplay.getInstance(), panel);
                  if (panel.getComponentCount() == 1)
                    {
                      comp = panel.getComponent(0);
                      panel.removeAll();
                    }
                  else
                    {
                      panel.setBackground(pane.getBackground());
                      comp = panel;
                    }
                  return comp;
                }
              });
          }
        else if (kind == ReplPane.PaintableElementName)
          {
            AttributeSet attr = elem.getAttributes();
            return new PaintableView(elem, (Paintable) attr.getAttribute(ReplPane.PaintableAttribute));
          }
        return styledFactory.create(elem);
      }
    };
}
 
开发者ID:maoueh,项目名称:kawa-fork,代码行数:48,代码来源:ReplPane.java

示例2: PaintableView

import gnu.kawa.models.Paintable; //导入依赖的package包/类
public PaintableView (Element elem, Paintable paintable)
{
  super(elem);
  this.p = paintable;
  this.bounds = paintable.getBounds2D();
}
 
开发者ID:maoueh,项目名称:kawa-fork,代码行数:7,代码来源:ReplPane.java

示例3: ReplEditorKit

import gnu.kawa.models.Paintable; //导入依赖的package包/类
public ReplEditorKit(final ReplPane pane)
{
  this.pane = pane;
  styledFactory = super.getViewFactory();
  factory = new ViewFactory ()
    {
      public View create(Element elem)
      {
        String kind = elem.getName();
        if (kind == ReplPane.ViewableElementName)
          {
            return (new ComponentView(elem)
              {
                protected Component createComponent()
                {
                  AttributeSet attr = getElement().getAttributes();
                  JPanel panel = new JPanel();
                  Viewable v = (Viewable) attr.getAttribute(ReplPane.ViewableAttribute);
                  Component comp;
                  // A kludge: We create a panel, and then since all current
                  // Viewables just create a Component and put it in the
                  // panel, we get rid of the useless JPanel.
                  v.makeView(SwingDisplay.getInstance(), panel);
                  if (panel.getComponentCount() == 1)
                    {
                      comp = panel.getComponent(0);
                      panel.removeAll();
                    }
                  else
                    {
                      panel.setBackground(pane.getBackground());
                      comp = panel;
                    }
                  return comp;
                }
              });
          }
        else if (kind == ReplPane.PaintableElementName)
          {
            AttributeSet attr = elem.getAttributes();
            return new PaintableView(elem, (Paintable) attr.getAttribute(ReplPane.PaintableAttribute));
          }
        return styledFactory.create(elem);
      }
    };
}
 
开发者ID:mit-cml,项目名称:ai2-kawa,代码行数:47,代码来源:ReplPane.java


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