當前位置: 首頁>>代碼示例>>Java>>正文


Java UIUtil.drawDottedRectangle方法代碼示例

本文整理匯總了Java中com.intellij.util.ui.UIUtil.drawDottedRectangle方法的典型用法代碼示例。如果您正苦於以下問題:Java UIUtil.drawDottedRectangle方法的具體用法?Java UIUtil.drawDottedRectangle怎麽用?Java UIUtil.drawDottedRectangle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.util.ui.UIUtil的用法示例。


在下文中一共展示了UIUtil.drawDottedRectangle方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: paintBorder

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected void paintBorder(Graphics g) {
//    if (/*myHasFocus ||*/ mySelected) {
    if (myHasFocus){
      int i1 = getBorderLeft();
      if (myDrawsFocusBorderAroundIcon){
        i1 = 0;
      }
      else
        if (i1 == -1){
          i1 = getBorderLeft();
        }
      Color color = getSelectionBorderColor();
      if (color != null){
        g.setColor(color);
        int j1 = getWidth() - 1;
        int k1 = getHeight() - 1;
        UIUtil.drawDottedRectangle(g, i1 > 0 ? i1 - 1 : i1, 0, j1, k1);
      }
    }
  }
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:BegCellRenderer.java

示例2: paintBorder

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void paintBorder() {
  final int row = FocusTracesDialog.this.myRequestsTable.getSelectedRow();
  if (row != -1) {
    final FocusRequestInfo info = FocusTracesDialog.this.myRequests.get(row);
    if (prev != null && prev != info.getComponent()) {
      prev.repaint();
    }
    prev = info.getComponent();
    if (prev != null && prev.isDisplayable()) {
      final Graphics g = prev.getGraphics();
      g.setColor(JBColor.RED);
      final Dimension sz = prev.getSize();
      UIUtil.drawDottedRectangle(g, 1, 1, sz.width - 2, sz.height - 2);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:FocusTracesDialog.java

示例3: paintFocusBorders

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void paintFocusBorders(boolean clean) {
  if (myCurrent != null) {
    Graphics currentFocusGraphics = myCurrent.getGraphics();
    if (currentFocusGraphics != null) {
      if (clean) {
        if (myCurrent.isDisplayable()) {
          myCurrent.repaint();
        }
      } else {
        currentFocusGraphics.setColor(myTemporary ? JBColor.ORANGE : JBColor.GREEN);
        UIUtil.drawDottedRectangle(currentFocusGraphics, 1, 1, myCurrent.getSize().width - 2, myCurrent.getSize().height - 2);
      }
    }
  }

  if (myPrevious != null) {
    Graphics previousFocusGraphics = myPrevious.getGraphics();
    if (previousFocusGraphics != null) {
      if (clean) {
        if (myPrevious.isDisplayable()) {
          myPrevious.repaint();
        }
      } else {
        previousFocusGraphics.setColor(JBColor.RED);
        UIUtil.drawDottedRectangle(previousFocusGraphics, 1, 1, myPrevious.getSize().width - 2, myPrevious.getSize().height - 2);
      }
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:FocusDebuggerAction.java

示例4: paintComponent

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected void paintComponent(Graphics g) {
  super.paintComponent(g);
  if (myFocused && myFocusedComponent != -1 && myVisibleComponents.get(myFocusedComponent) == this) {
    g.setColor(UIUtil.getTableSelectionForeground());
    UIUtil.drawDottedRectangle(g, 0, 0, getWidth() - 2, getHeight() - 2);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:AvdActionPanel.java

示例5: paintBorder

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
  g.setColor(myColor);
  UIUtil.drawDottedRectangle(g, x, y, x + width - 1, y + height - 1);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:DottedBorder.java

示例6: paintBorder

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int width, final int height) {
  g.setColor(Color.BLACK);
  UIUtil.drawDottedRectangle(g, x, y, x + width - 1, y + height - 1);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:SimpleColoredComponent.java

示例7: paint

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void paint(Graphics g) {
  int height = getHeight();
  int width = getWidth();
  int borderX = myLabelInsets.left - 1;
  int borderY = myLabelInsets.top - 1;
  int borderW = width - borderX - myLabelInsets.right + 2;
  int borderH = height - borderY - myLabelInsets.bottom + 1;

  if (myIcon != null) {
    int verticalIconPosition = (height - myIcon.getIconHeight())/2;
    myIcon.paintIcon(this, g, 0, verticalIconPosition);
    borderX += myIcon.getIconWidth();
    borderW -= myIcon.getIconWidth();
  }

  Color bgColor;
  Color fgColor;
  if (mySelected && myHasFocus){
    bgColor = UIUtil.getTreeSelectionBackground();
    fgColor = UIUtil.getTreeSelectionForeground();
  }
  else{
    bgColor = UIUtil.getTreeTextBackground();
    fgColor = getForeground();
  }

  // fill background
  if (!(myTree.getUI() instanceof WideSelectionTreeUI) || !((WideSelectionTreeUI)myTree.getUI()).isWideSelection()) {
    g.setColor(bgColor);
    g.fillRect(borderX, borderY, borderW, borderH);

    // draw border
    if (mySelected) {
      g.setColor(UIUtil.getTreeSelectionBorderColor());
      UIUtil.drawDottedRectangle(g, borderX, borderY, borderX + borderW - 1, borderY + borderH - 1);
    }
  }

  // paint text
  recalculateWraps();

  if (myTooSmall) { // TODO ???
    return;
  }

  int fontHeight = getCurrFontMetrics().getHeight();
  int currBaseLine = getCurrFontMetrics().getAscent();
  currBaseLine += myTextInsets.top;
  g.setFont(getFont());
  g.setColor(fgColor);
  UISettings.setupAntialiasing(g);

  if (!StringUtil.isEmpty(myPrefix)) {
    g.drawString(myPrefix, myTextInsets.left - myPrefixWidth + 1, currBaseLine);
  }

  for (int i = 0; i < myWraps.size(); i++) {
    String currLine = (String)myWraps.get(i);
    g.drawString(currLine, myTextInsets.left, currBaseLine);
    currBaseLine += fontHeight;  // first is getCurrFontMetrics().getAscent()
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:63,代碼來源:MultilineTreeCellRenderer.java

示例8: paintFocus

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {
  UIUtil.drawDottedRectangle(g, viewRect.x, viewRect.y, viewRect.x + viewRect.width, viewRect.y + viewRect.height);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:BegButtonUI.java

示例9: paintFocus

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) {
  g.setColor(getFocusColor());
  UIUtil.drawDottedRectangle(g, viewRect.x, viewRect.y, viewRect.x + viewRect.width, viewRect.y + viewRect.height);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:BegToggleButtonUI.java

示例10: paintFocus

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected void paintFocus(Graphics g, Rectangle t, Dimension d) {
  g.setColor(getFocusColor());
  UIUtil.drawDottedRectangle(g, t.x - 2, t.y - 1, t.x + t.width + 1, t.y + t.height);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:BegRadioButtonUI.java


注:本文中的com.intellij.util.ui.UIUtil.drawDottedRectangle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。