當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。