MacUIUtil.getInvertedTextCursor(): Cursor.getPredefinedCursor(Cursor.TEXT_CURSOR);
}
- public enum FontSize { NORMAL, TREE, SMALL, MINI }
+ public enum FontSize {NORMAL, TREE, SMALL, MINI}
public enum ComponentStyle {REGULAR, SMALL, MINI}
public enum FontColor {NORMAL, BRIGHTER}
-
public static final char MNEMONIC = 0x1B;
@NonNls public static final String HTML_MIME = "text/html";
@NonNls public static final String JSLIDER_ISFILLED = "JSlider.isFilled";
private static final Color ACTIVE_HEADER_COLOR = new Color(160, 186, 213);
private static final Color INACTIVE_HEADER_COLOR = new Color(128, 128, 128);
private static final Color BORDER_COLOR = Color.LIGHT_GRAY;
- public static Color AQUA_SEPARATOR_FOREGROUND_COLOR = new Color(190, 190, 190);
- public static Color AQUA_SEPARATOR_BACKGROUND_COLOR = new Color(240, 240, 240);
+
+ public static final Color AQUA_SEPARATOR_FOREGROUND_COLOR = new Color(190, 190, 190);
+ public static final Color AQUA_SEPARATOR_BACKGROUND_COLOR = new Color(240, 240, 240);
+ public static final Color TRANSPARENT_COLOR = new Color(0, 0, 0, 0);
public static final int DEFAULT_HGAP = 8;
public static final int DEFAULT_VGAP = 4;
@NotNull
public static Font getFont(@NotNull FontSize size, @Nullable Font base) {
- Font defFont = getLabelFont();
- if (base == null) base = defFont;
+ if (base == null) base = getLabelFont();
+
+ return base.deriveFont(getFontSize(size));
+ }
+ public static float getFontSize(FontSize size) {
+ int defSize = getLabelFont().getSize();
switch (size) {
case TREE:
- return base.deriveFont(Math.max(defFont.getSize() - 2f, 12f));
+ return Math.max(defSize - 2f, 12f);
case SMALL:
- return base.deriveFont(Math.max(defFont.getSize() - 2f, 11f));
+ return Math.max(defSize - 2f, 11f);
case MINI:
- return base.deriveFont(Math.max(defFont.getSize() - 4f, 9f));
+ return Math.max(defSize - 4f, 9f);
default:
- return base.deriveFont(defFont.getSize());
+ return defSize;
}
}
return UIManager.getLookAndFeel().getName().contains("Alloy");
}
+ @SuppressWarnings({"HardCodedStringLiteral"})
+ public static boolean isUnderAlloyIDEALookAndFeel() {
+ return isUnderAlloyLookAndFeel() && UIManager.getLookAndFeel().getName().contains("IDEA");
+ }
+
@SuppressWarnings({"HardCodedStringLiteral"})
public static boolean isUnderWindowsLookAndFeel() {
return UIManager.getLookAndFeel().getName().contains("Windows");
return false;
}
- public static void mergeComponentsWithAnchor(PanelWithAnchor c1,PanelWithAnchor c2) {
+ public static void mergeComponentsWithAnchor(PanelWithAnchor c1, PanelWithAnchor c2) {
if (c1 == null || c2 == null) return;
if (c1.getAnchor() == null) {
}
}
- public static void setNotOpaqueRecursively(Component component) {
- if (component == null) return;
+ public static void setNotOpaqueRecursively(@NotNull Component component) {
if (!isUnderAquaLookAndFeel()) return;
if (component.getBackground().equals(getPanelBackground()) || component instanceof JScrollPane || component instanceof JViewport) {
}
}
- public static void addInsets(JComponent component, Insets insets) {
+ public static void addInsets(@NotNull JComponent component, @NotNull Insets insets) {
if (component.getBorder() != null) {
component.setBorder(new CompoundBorder(new EmptyBorder(insets), component.getBorder()));
}
component.setBorder(new EmptyBorder(insets));
}
}
+
+ public static Dimension addInsets(@NotNull Dimension dimension, @NotNull Insets insets) {
+
+ Dimension ans = new Dimension(dimension);
+ ans.width += insets.left;
+ ans.width += insets.right;
+ ans.height += insets.top;
+ ans.height += insets.bottom;
+
+ return ans;
+ }
}