OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 174 | Rev 182 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 174 Rev 177
Line 16... Line 16...
16
import java.awt.BasicStroke;
16
import java.awt.BasicStroke;
17
import java.awt.Color;
17
import java.awt.Color;
18
import java.awt.Dimension;
18
import java.awt.Dimension;
19
import java.awt.Graphics;
19
import java.awt.Graphics;
20
import java.awt.Graphics2D;
20
import java.awt.Graphics2D;
-
 
21
import java.awt.Rectangle;
21
import java.awt.event.MouseAdapter;
22
import java.awt.event.MouseAdapter;
22
import java.awt.event.MouseEvent;
23
import java.awt.event.MouseEvent;
23
import java.awt.event.MouseMotionListener;
24
import java.awt.event.MouseMotionListener;
24
import java.util.ArrayList;
25
import java.util.ArrayList;
25
import java.util.HashMap;
26
import java.util.HashMap;
Line 27... Line 28...
27
import java.util.List;
28
import java.util.List;
28
import java.util.Map;
29
import java.util.Map;
29
import java.util.Set;
30
import java.util.Set;
30
 
31
 
31
import javax.swing.JFrame;
32
import javax.swing.JFrame;
32
import javax.swing.JPanel;
-
 
33
import javax.swing.SwingUtilities;
33
import javax.swing.SwingUtilities;
34
import javax.swing.UIManager;
34
import javax.swing.UIManager;
35
import javax.swing.UnsupportedLookAndFeelException;
35
import javax.swing.UnsupportedLookAndFeelException;
36
 
36
 
37
public class GridPanel extends JPanel {
37
public class GridPanel extends ScrollablePanel {
38
    private static final Color SELECTION_BORDER_COLOR = new Color(200, 210, 220, 250);
38
    private static final Color SELECTION_BORDER_COLOR = new Color(200, 210, 220, 250);
39
    private static final Color SELECTION_COLOR = new Color(230, 240, 250, 180);
39
    private static final Color SELECTION_COLOR = new Color(230, 240, 250, 180);
40
    private static final Color CREATION_COLOR = new Color(250, 254, 30, 100);
40
    private static final Color CREATION_COLOR = new Color(250, 254, 30, 100);
41
    private static final Color CREATION_BORDER_COLOR = new Color(250, 254, 60, 180);
41
    private static final Color CREATION_BORDER_COLOR = new Color(250, 254, 60, 180);
42
 
42
 
Line 314... Line 314...
314
    }
314
    }
315
 
315
 
316
    public List<GridItem> getSelectedItems() {
316
    public List<GridItem> getSelectedItems() {
317
        return new ArrayList<>(this.selectedItems);
317
        return new ArrayList<>(this.selectedItems);
318
    }
318
    }
-
 
319
 
-
 
320
    @Override
-
 
321
    public Dimension getPreferredScrollableViewportSize() {
-
 
322
        // TODO Auto-generated method stub
-
 
323
        return null;
-
 
324
    }
-
 
325
 
-
 
326
    @Override
-
 
327
    public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) {
-
 
328
        // TODO Auto-generated method stub
-
 
329
        return 40;
-
 
330
    }
-
 
331
 
-
 
332
    @Override
-
 
333
    public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) {
-
 
334
        // TODO Auto-generated method stub
-
 
335
        return 40;
-
 
336
    }
-
 
337
 
-
 
338
    @Override
-
 
339
    public boolean getScrollableTracksViewportWidth() {
-
 
340
        // TODO Auto-generated method stub
-
 
341
        return false;
-
 
342
    }
-
 
343
 
-
 
344
    @Override
-
 
345
    public boolean getScrollableTracksViewportHeight() {
-
 
346
        // TODO Auto-generated method stub
-
 
347
        return false;
-
 
348
    }
319
}
349
}