Mercurial Hosting > junotu
comparison src/junotu/ColumnCardWidget.java @ 121:cc1df2f32f2b
TabColumnBoard and TabCalendarBoard cards now expand vertically to accomodate longer titless
author | Fox |
---|---|
date | Sat, 25 Nov 2023 15:18:53 +0100 |
parents | 6a78c671a7cf |
children |
comparison
equal
deleted
inserted
replaced
120:6a78c671a7cf | 121:cc1df2f32f2b |
---|---|
21 import junotu.Card; | 21 import junotu.Card; |
22 import junotu.TabColumnBoard; | 22 import junotu.TabColumnBoard; |
23 | 23 |
24 class ColumnCardWidget extends JPanel { | 24 class ColumnCardWidget extends JPanel { |
25 | 25 |
26 final static int CARD_MINIMUM_HEIGHT = 64; | |
27 | |
26 public boolean newCard; | 28 public boolean newCard; |
27 public long identifier; | 29 public long identifier; |
28 public JTextArea title; | 30 public JTextArea title; |
29 | 31 |
30 public ColumnCardWidget( Card card ) | 32 public ColumnCardWidget( Card card ) |
32 this.setLayout( new BorderLayout() ); | 34 this.setLayout( new BorderLayout() ); |
33 | 35 |
34 title = new JTextArea(""); | 36 title = new JTextArea(""); |
35 | 37 |
36 title.setFont( new Font( "Monospaced", Font.BOLD, 16 ) ); | 38 title.setFont( new Font( "Monospaced", Font.BOLD, 16 ) ); |
37 | |
38 this.setMinimumSize( new Dimension( TabColumnBoard.COLUMN_CONTENT_WIDTH, 64 ) ); | |
39 this.setPreferredSize( new Dimension( TabColumnBoard.COLUMN_CONTENT_WIDTH, 64 ) ); | |
40 this.setMaximumSize( new Dimension( TabColumnBoard.COLUMN_CONTENT_WIDTH, 128 ) ); | |
41 | |
42 //title.setMinimumSize( new Dimension( 32, 32 ) ); | |
43 | 39 |
44 this.setBorder( BorderFactory.createRaisedBevelBorder() ); | 40 this.setBorder( BorderFactory.createRaisedBevelBorder() ); |
45 title.setEditable( true ); | 41 title.setEditable( true ); |
46 title.setLineWrap( true ); | 42 title.setLineWrap( true ); |
47 title.setWrapStyleWord( true ); | 43 title.setWrapStyleWord( true ); |
65 if( !newCard ) { | 61 if( !newCard ) { |
66 identifier = card.identifierGet().longValue(); | 62 identifier = card.identifierGet().longValue(); |
67 title.setText(card.titleGet()); | 63 title.setText(card.titleGet()); |
68 } | 64 } |
69 | 65 |
66 } | |
67 | |
68 public Dimension getMinimumSize() | |
69 { | |
70 Dimension d = super.getMinimumSize(); | |
71 d.height = Math.max( CARD_MINIMUM_HEIGHT, d.height ); | |
72 return d; | |
73 } | |
74 | |
75 public Dimension getMaximumSize() | |
76 { | |
77 Dimension d = super.getMaximumSize(); | |
78 d.height = Math.max( CARD_MINIMUM_HEIGHT, d.height ); | |
79 return d; | |
80 } | |
81 | |
82 public Dimension getPreferredSize() | |
83 { | |
84 Dimension d = super.getPreferredSize(); | |
85 d.height = Math.max( CARD_MINIMUM_HEIGHT, d.height ); | |
86 return d; | |
70 } | 87 } |
71 | 88 |
72 public void save() | 89 public void save() |
73 { | 90 { |
74 try { | 91 try { |