Browse Source

scroll bar

master
hzzz 7 years ago
parent
commit
97f154abde
  1. 6
      designer_base/src/com/fr/design/constants/UIConstants.java
  2. 4
      designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java
  3. 3
      designer_base/src/com/fr/design/gui/icontainer/UIScrollPaneUI.java
  4. 3
      designer_base/src/com/fr/design/gui/iscrollbar/UIScrollBarUI.java

6
designer_base/src/com/fr/design/constants/UIConstants.java

@ -70,7 +70,7 @@ public interface UIConstants {
public static final Color SHADOW_GREY = new Color(217, 218, 221);
public static final Color SHADOW_CENTER = new Color(200, 200, 200);
public static final Color SHADOW_PURPLE = new Color(255, 0, 255);
public static final Color FLESH_BLUE = new Color(70, 157, 246);
public static final Color FLESH_BLUE = new Color(65, 155, 249);
public static final Color HOVER_BLUE = new Color(0xd2d2d2);
public static final Color DOTTED_LINE_COLOR = new Color(35, 108, 184);
public static final Color AUTHORITY_COLOR = new Color(88, 125, 153);
@ -142,9 +142,9 @@ public interface UIConstants {
public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit.png");
public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127);
public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45);
public static final Color BARNOMAL = new Color(153, 153, 153);
public static final Color BARNOMAL = new Color(232, 232, 233);
public static final int ARC = 0;
public static final int LARGEARC = 0;
public static final int LARGEARC = 6;
public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0);
public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png");
public static final Icon CLOSE_OF_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close.png");

4
designer_base/src/com/fr/design/gui/icontainer/UIScrollPane.java

@ -19,6 +19,10 @@ public class UIScrollPane extends JScrollPane {
this.setHorizontalScrollBar(createHorizontalScrollBar());
this.getVerticalScrollBar().setUnitIncrement(30);
this.getVerticalScrollBar().setBlockIncrement(30);
this.getHorizontalScrollBar().setOpaque(true);
this.getHorizontalScrollBar().setBackground(Color.WHITE);
this.getVerticalScrollBar().setOpaque(true);
this.getVerticalScrollBar().setBackground(Color.WHITE);
}
@Override

3
designer_base/src/com/fr/design/gui/icontainer/UIScrollPaneUI.java

@ -4,6 +4,7 @@ import javax.swing.*;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.metal.MetalScrollBarUI;
import javax.swing.plaf.metal.MetalScrollPaneUI;
import java.awt.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@ -35,11 +36,13 @@ public class UIScrollPaneUI extends MetalScrollPaneUI implements PropertyChangeL
// Note: It never happened before Java 1.5 that scrollbar is null
JScrollBar sb = scrollpane.getHorizontalScrollBar();
if (sb != null) {
sb.setBackground(Color.red);
sb.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE);
}
sb = scrollpane.getVerticalScrollBar();
if (sb != null) {
sb.setBackground(Color.red);
sb.putClientProperty(MetalScrollBarUI.FREE_STANDING_PROP, Boolean.FALSE);
}
}

3
designer_base/src/com/fr/design/gui/iscrollbar/UIScrollBarUI.java

@ -467,8 +467,7 @@ public class UIScrollBarUI extends ScrollBarUI implements LayoutManager, SwingCo
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2.translate(thumbBounds.x, thumbBounds.y);
Color color = isDragging ? UIConstants.LINE_COLOR : UIConstants.BARNOMAL;
color = isPressing ? UIConstants.LINE_COLOR : UIConstants.BARNOMAL;
Color color = isPressing ? UIConstants.LINE_COLOR : UIConstants.BARNOMAL;
g2.setColor(color);
g2.fillRoundRect(1, 1, width - 2, height - 2, UIConstants.LARGEARC, UIConstants.LARGEARC);

Loading…
Cancel
Save