mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-21 08:49:39 +01:00
JBR-1414 [Test] downscale frames to run on low-dpi screens
(cherry picked from commitb46e74fe6f) (cherry picked from commit844b3e1d5f)
This commit is contained in:
committed by
jbrbot
parent
d9bbdda78b
commit
93726ff25d
@@ -173,7 +173,7 @@ class DragSourceFrame extends JFrame implements DragGestureListener {
|
|||||||
void initUI() {
|
void initUI() {
|
||||||
this.setLocation(0, 0);
|
this.setLocation(0, 0);
|
||||||
JPanel contentPane = new JPanel(null);
|
JPanel contentPane = new JPanel(null);
|
||||||
contentPane.setPreferredSize(new Dimension(100, 100));
|
contentPane.setPreferredSize(new Dimension(50, 50));
|
||||||
|
|
||||||
sourcePanel = new JPanel() {
|
sourcePanel = new JPanel() {
|
||||||
@Override
|
@Override
|
||||||
@@ -181,10 +181,10 @@ class DragSourceFrame extends JFrame implements DragGestureListener {
|
|||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
Graphics2D g2 = (Graphics2D) g;
|
Graphics2D g2 = (Graphics2D) g;
|
||||||
g2.setColor(this.getBackground());
|
g2.setColor(this.getBackground());
|
||||||
g2.fillRect(0, 0, 100, 100);
|
g2.fillRect(0, 0, 50, 50);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
sourcePanel.setBounds(0, 0, 100, 100);
|
sourcePanel.setBounds(0, 0, 50,50);
|
||||||
sourcePanel.setEnabled(true);
|
sourcePanel.setEnabled(true);
|
||||||
sourcePanel.setBackground(Color.white);
|
sourcePanel.setBackground(Color.white);
|
||||||
|
|
||||||
@@ -298,7 +298,7 @@ class DropTargetFrame extends JFrame {
|
|||||||
void initUI(Point frameLocation) {
|
void initUI(Point frameLocation) {
|
||||||
this.setLocation(frameLocation);
|
this.setLocation(frameLocation);
|
||||||
JPanel contentPane = new JPanel(null);
|
JPanel contentPane = new JPanel(null);
|
||||||
contentPane.setPreferredSize(new Dimension(400, 400));
|
contentPane.setPreferredSize(new Dimension(200,200));
|
||||||
|
|
||||||
dtPanel = new JPanel() {
|
dtPanel = new JPanel() {
|
||||||
@Override
|
@Override
|
||||||
@@ -306,11 +306,11 @@ class DropTargetFrame extends JFrame {
|
|||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
Graphics2D g2 = (Graphics2D) g;
|
Graphics2D g2 = (Graphics2D) g;
|
||||||
g2.setColor(this.getBackground());
|
g2.setColor(this.getBackground());
|
||||||
g2.fillRect(0, 0, 200, 200);
|
g2.fillRect(0, 0, 100,100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
dtPanel.setBounds(100, 100, 200, 200);
|
dtPanel.setBounds(50,50, 100, 100);
|
||||||
dtPanel.setEnabled(true);
|
dtPanel.setEnabled(true);
|
||||||
dtPanel.setBackground(Color.white);
|
dtPanel.setBackground(Color.white);
|
||||||
dtPanel.setDropTarget(new DropTarget(dtPanel, DnDConstants.ACTION_COPY_OR_MOVE, new DropTargetAdapter() {
|
dtPanel.setDropTarget(new DropTarget(dtPanel, DnDConstants.ACTION_COPY_OR_MOVE, new DropTargetAdapter() {
|
||||||
|
|||||||
Reference in New Issue
Block a user