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


Java UIUtil.isUnderDarcula方法代碼示例

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


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

示例1: createTaskInfoPanel

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public JComponent createTaskInfoPanel(Project project) {
  myTaskTextPane = new JTextPane();
  final JBScrollPane scrollPane = new JBScrollPane(myTaskTextPane);
  myTaskTextPane.setContentType(new HTMLEditorKit().getContentType());
  final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
  int fontSize = editorColorsScheme.getEditorFontSize();
  final String fontName = editorColorsScheme.getEditorFontName();
  final Font font = new Font(fontName, Font.PLAIN, fontSize);
  String bodyRule = "body { font-family: " + font.getFamily() + "; " +
                    "font-size: " + font.getSize() + "pt; }" +
                    "pre {font-family: Courier; display: inline; ine-height: 50px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; background-color:"
                    + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}" +
                    "code {font-family: Courier; display: flex; float: left; background-color:"
                    + ColorUtil.toHex(ColorUtil.dimmer(UIUtil.getPanelBackground())) + ";}";
  ((HTMLDocument)myTaskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
  myTaskTextPane.setEditable(false);
  if (!UIUtil.isUnderDarcula()) {
    myTaskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
  }
  myTaskTextPane.setBorder(new EmptyBorder(20, 20, 0, 10));
  myTaskTextPane.addHyperlinkListener(BrowserHyperlinkListener.INSTANCE);
  return scrollPane;
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:25,代碼來源:StudySwingToolWindow.java

示例2: lookAndFeelChanged

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
public void lookAndFeelChanged(LafManager source) {
    final Color background = UIUtil.isUnderDarcula()
            ? JBColor.background()
            : JBColor.black;

    inputTerminal.setBackground(background);
    // TODO: Upstream fix for Kahlua
    outputTerminal.setBackground(background);

    // Find the panes we are looking for
    JScrollPane scrollPane = (JScrollPane) outputTerminal.getComponent(0);
    JPanel panel1 = (JPanel) scrollPane.getViewport().getView();
    JPanel panel2 = (JPanel) panel1.getComponent(0);

    // Set the background onto the panes directly
    JPanel panel3 = (JPanel) panel2.getComponent(0);
    panel3.setBackground(background);
    JEditorPane editorPane = (JEditorPane) panel2.getComponent(1);
    editorPane.setBackground(background);
}
 
開發者ID:internetisalie,項目名稱:lua-for-idea,代碼行數:22,代碼來源:LuaJInterpreter.java

示例3: createTaskTextPane

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@NotNull
private static JTextPane createTaskTextPane() {
  final JTextPane taskTextPane = new JTextPane();
  taskTextPane.setContentType(new HTMLEditorKit().getContentType());
  final EditorColorsScheme editorColorsScheme = EditorColorsManager.getInstance().getGlobalScheme();
  int fontSize = editorColorsScheme.getEditorFontSize();
  final String fontName = editorColorsScheme.getEditorFontName();
  final Font font = new Font(fontName, Font.PLAIN, fontSize);
  String bodyRule = "body { font-family: " + font.getFamily() + "; " +
                    "font-size: " + font.getSize() + "pt; }";
  ((HTMLDocument)taskTextPane.getDocument()).getStyleSheet().addRule(bodyRule);
  taskTextPane.setEditable(false);
  if (!UIUtil.isUnderDarcula()) {
    taskTextPane.setBackground(EditorColorsManager.getInstance().getGlobalScheme().getDefaultBackground());
  }
  taskTextPane.setBorder(new EmptyBorder(15, 20, 0, 100));
  return taskTextPane;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:19,代碼來源:StudyToolWindow.java

示例4: paintComponent

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Override
protected void paintComponent(Graphics g) {
  if (myChars == null) {
    return;
  }
  
  g.setColor(myIsError ? JBColor.red : JBColor.border());
  Rectangle bounds = getBounds();
  ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
  int y = Math.max(0, myBaseLine - myHeight - (myDiameter - myHeight) / 2);
  g.drawOval(0, y, myDiameter, myDiameter);

  if (UIUtil.isUnderDarcula()) {
    g.setColor(UIUtil.getLabelForeground());
  }
  g.drawChars(myChars, 0, myChars.length, (bounds.width - myIndexWidth) / 2, myBaseLine);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ArrangementRuleIndexControl.java

示例5: initFramePainters

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public static void initFramePainters(@NotNull PaintersHelper painters) {
  PaintersHelper.initWallpaperPainter("idea.wallpaper.ide", painters);

  ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
  String path = UIUtil.isUnderDarcula()? appInfo.getEditorBackgroundImageUrl() : null;
  URL url = path == null ? null : appInfo.getClass().getResource(path);
  Image centerImage = url == null ? null : ImageLoader.loadFromUrl(url);

  if (centerImage != null) {
    painters.addPainter(PaintersHelper.newImagePainter(centerImage, PaintersHelper.FillType.TOP_CENTER, 1.0f, JBUI.insets(10, 0, 0, 0)), null);
  }
  painters.addPainter(new AbstractPainter() {
    EditorEmptyTextPainter p = ServiceManager.getService(EditorEmptyTextPainter.class);

    @Override
    public boolean needsRepaint() {
      return true;
    }

    @Override
    public void executePaint(Component component, Graphics2D g) {
      p.paintEmptyText((JComponent)component, g);
    }
  }, null);

}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:IdeBackgroundUtil.java

示例6: getLanguageSettingsComponent

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@Nullable
@Override
public LabeledComponent<JComponent> getLanguageSettingsComponent(@NotNull Course selectedCourse) {
  final Project project = ProjectManager.getInstance().getDefaultProject();
  PyConfigurableInterpreterList instance = PyConfigurableInterpreterList.getInstance(project);
  if (instance == null) {
    return null;
  }
  final List<Sdk> sdks = instance.getAllPythonSdks();
  VirtualEnvProjectFilter.removeAllAssociated(sdks);
  // by default we create new virtual env in project, we need to add this non-existing sdk to sdk list
  ProjectJdkImpl fakeSdk = createFakeSdk(selectedCourse);
  if (fakeSdk != null) {
    sdks.add(0, fakeSdk);
  }
  PythonSdkChooserCombo combo = new PythonSdkChooserCombo(project, sdks, sdk -> true);
  if (fakeSdk != null) {
    patchRenderer(fakeSdk, combo);
    combo.getComboBox().setSelectedItem(fakeSdk);
  }
  if (SystemInfo.isMac && !UIUtil.isUnderDarcula()) {
    combo.putClientProperty("JButton.buttonType", null);
  }
  combo.setButtonIcon(PythonIcons.Python.InterpreterGear);
  combo.addChangedListener(e -> {
    Sdk selectedSdk = (Sdk)combo.getComboBox().getSelectedItem();
    mySettings.setSdk(selectedSdk == fakeSdk ? null : selectedSdk);
  });
  return LabeledComponent.create(combo, "Interpreter", BorderLayout.WEST);
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:31,代碼來源:PyStudyDirectoryProjectGenerator.java

示例7: isolatedBackgroundColorRGB

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void isolatedBackgroundColorRGB(java.awt.Color color) {
    if (UIUtil.isUnderDarcula()) {
        myIsolatedBackgroundDarkColor = color.getRGB();
    } else {
        myIsolatedBackgroundColor = color.getRGB();
    }
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:8,代碼來源:ApplicationSettings.java

示例8: setSaturationMax

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void setSaturationMax(final int saturationMax) {
    if (UIUtil.isUnderDarcula()) {
        myDarkGradientSaturationMax = saturationMax;
    } else {
        myGradientSaturationMax = saturationMax;
    }
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:8,代碼來源:ApplicationSettings.java

示例9: searchStartCaretColorRGB

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void searchStartCaretColorRGB(final java.awt.Color primaryCaretColor) {
    if (UIUtil.isUnderDarcula()) {
        mySearchStartCaretDarkColor = primaryCaretColor.getRGB();
    } else {
        mySearchStartCaretColor = primaryCaretColor.getRGB();
    }
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:8,代碼來源:ApplicationSettings.java

示例10: paintComponent

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
protected void paintComponent(final Graphics g) {
  if (myCompact) {
    super.paintComponent(g);
    return;
  }

  final GraphicsConfig c = GraphicsUtil.setupAAPainting(g);
  UISettings.setupAntialiasing(g);

  int arc = 8;
  Color bg = getBackground();
  final Rectangle bounds = myProcessName.getBounds();
  final Rectangle label = SwingUtilities.convertRectangle(myProcessName.getParent(), bounds, this);

  g.setColor(UIUtil.getPanelBackground());
  g.fillRoundRect(0, 0, getWidth() - 1, getHeight() - 1, arc, arc);

  if (!UIUtil.isUnderDarcula()) {
    bg = ColorUtil.toAlpha(bg.darker().darker(), 230);
    g.setColor(bg);

    g.fillRoundRect(0, 0, getWidth() - 1, getHeight() - 1, arc, arc);

    g.setColor(UIUtil.getPanelBackground());
    g.fillRoundRect(0, getHeight() / 2, getWidth() - 1, getHeight() / 2, arc, arc);
    g.fillRect(0, (int)label.getMaxY() + 1, getWidth() - 1, getHeight() / 2);
  } else {
    bg = bg.brighter();
    g.setColor(bg);
    g.drawLine(0, (int)label.getMaxY() + 1, getWidth() - 1, (int)label.getMaxY() + 1);
  }

  g.setColor(bg);
  g.drawRoundRect(0, 0, getWidth() - 1, getHeight() - 1, arc, arc);

  c.restore();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:38,代碼來源:InlineProgressIndicator.java

示例11: getIndicatorColor

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
@NotNull
public static JBColor getIndicatorColor(@NotNull final Color baseRootColor) {
  if (Registry.is("vcs.log.square.labels")) return getBackgroundColor(baseRootColor);
  return new JBColor(new NotNullProducer<Color>() {
    @NotNull
    @Override
    public Color produce() {
      if (UIUtil.isUnderDarcula()) return baseRootColor;
      return ColorUtil.darker(ColorUtil.softer(baseRootColor), 2);
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:VcsLogColorManagerImpl.java

示例12: getDefaultAttributes

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public TextAttributes getDefaultAttributes(TextAttributesKey key) {
  final boolean dark = UIUtil.isUnderDarcula() && getScheme("Darcula") != null;
  // It is reasonable to fetch attributes from Default color scheme. Otherwise if we launch IDE and then
  // try switch from custom colors scheme (e.g. with dark background) to default one. Editor will show
  // incorrect highlighting with "traces" of color scheme which was active during IDE startup.
  return getScheme(dark ? "Darcula" : EditorColorsScheme.DEFAULT_SCHEME_NAME).getAttributes(key);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:EditorColorsManagerImpl.java

示例13: recalledSelectionColorRGB

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
public void recalledSelectionColorRGB(final java.awt.Color color) {
    if (UIUtil.isUnderDarcula()) {
        myRecalledSelectionDarkColor = color.getRGB();
    } else {
        myRecalledSelectionColor = color.getRGB();
    }
}
 
開發者ID:vsch,項目名稱:MissingInActions,代碼行數:8,代碼來源:ApplicationSettings.java

示例14: getColorSchemeForBackground

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
/**
 * @return the appropriate color scheme for UI other than text editor (QuickDoc, UsagesView, etc.)
 * depending on the current LAF, current editor color scheme and background color.
 */
public static EditorColorsScheme getColorSchemeForBackground(@Nullable Color background) {
  EditorColorsScheme globalScheme = EditorColorsManager.getInstance().getGlobalScheme();
  boolean dark1 = background == null ? UIUtil.isUnderDarcula() : ColorUtil.isDark(background);
  boolean dark2 = ColorUtil.isDark(globalScheme.getDefaultBackground());
  if (dark1 != dark2) {
    EditorColorsScheme scheme = EditorColorsManager.getInstance().getScheme(EditorColorsScheme.DEFAULT_SCHEME_NAME);
    if (scheme != null) {
      return scheme;
    }
  }
  return globalScheme;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:EditorColorsUtil.java

示例15: layoutPanel

import com.intellij.util.ui.UIUtil; //導入方法依賴的package包/類
private void layoutPanel() {
  myCoursesComboBox = new ComboBox<>();

  final LabeledComponent<ComboBox> coursesCombo = LabeledComponent.create(myCoursesComboBox, "Courses:", BorderLayout.WEST);

  myRefreshButton = new FixedSizeButton(coursesCombo);
  if (SystemInfo.isMac && !UIUtil.isUnderDarcula())
    myRefreshButton.putClientProperty("JButton.buttonType", null);
  myRefreshButton.setIcon(AllIcons.Actions.Refresh);
  myBrowseButton = new FixedSizeButton(coursesCombo);

  final JPanel comboPanel = new JPanel(new BorderLayout());
  comboPanel.add(coursesCombo, BorderLayout.CENTER);
  comboPanel.add(myRefreshButton, BorderLayout.EAST);

  final JPanel coursesPanel = new JPanel(new BorderLayout());
  coursesPanel.add(comboPanel, BorderLayout.CENTER);
  coursesPanel.add(myBrowseButton, BorderLayout.EAST);

  add(coursesPanel);
  myAnchor = coursesCombo;

  final JPanel panel = new JPanel(new BorderLayout());
  final JLabel invisibleLabel = new JLabel();
  invisibleLabel.setPreferredSize(new JLabel("Location: ").getPreferredSize());
  panel.add(invisibleLabel, BorderLayout.WEST);

  myInfoPanel = new JPanel(new VerticalFlowLayout());
  myAuthorLabel = new JLabel();
  myDescriptionPane = new JTextPane();
  myDescriptionPane.setEditable(true);
  myDescriptionPane.setEnabled(true);
  myAuthorLabel.setEnabled(true);
  myDescriptionPane.setPreferredSize(new Dimension(150, 200));
  myDescriptionPane.setFont(coursesCombo.getFont());
  myInfoPanel.add(myAuthorLabel);
  myInfoPanel.add(new JBScrollPane(myDescriptionPane));

  panel.add(myInfoPanel, BorderLayout.CENTER);
  add(panel);
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:42,代碼來源:StudyNewProjectPanel.java


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