Changeset 10701 for extensions
- Timestamp:
- Apr 30, 2011, 3:18:37 PM (14 years ago)
- Location:
- extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/comments
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/comments/CommentPanel.java
r6980 r10701 7 7 import java.awt.Font; 8 8 9 import javax.swing.JFrame; 9 10 import javax.swing.JLabel; 10 11 import javax.swing.JPanel; 11 12 import javax.swing.JTextArea; 13 import javax.swing.UIManager; 14 import javax.swing.UnsupportedLookAndFeelException; 15 16 import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel; 12 17 13 18 /** … … 58 63 this.setBackground(color); 59 64 JTextArea area = new JTextArea("\n\n\t" + text); 65 //trick : allows the area to be transparent 66 area.setBackground(new Color(0, 0, 0, 0)); 67 area.setForeground(Color.WHITE); 60 68 area.setFont(area.getFont().deriveFont(Font.BOLD)); 61 69 area.setPreferredSize(new Dimension(550, 100)); … … 68 76 panelHaut.setPreferredSize(new Dimension(550, 50)); 69 77 panelHaut.setOpaque(false); 78 panelHaut.setBackground(Color.white); 79 panelHaut.setBorder(new TopRoundedBorder(45)); 70 80 JLabel labelAuteur = new JLabel(auteur); 71 81 JLabel labelDate = new JLabel(date); … … 73 83 panelHaut.add(labelDate); 74 84 85 this.setBorder(new RoundedBorder(45)); 86 this.setOpaque(false); 87 75 88 this.add(panelHaut, BorderLayout.NORTH); 76 89 this.add(area, BorderLayout.CENTER); 77 90 } 78 91 92 // @Override 93 // public void paint(Graphics g) { 94 // super.paint(g); 95 // // TODO Auto-generated method stub 96 // Graphics2D g2 = (Graphics2D) g; 97 // try { 98 // g2.drawImage(ImageIO.read(new File( 99 // "/home/mael/workspace/jiwigo/src/main/resources/fr/mael/jiwigo/img/79e56b_top.png")), 0, 0, this); 100 // } catch (IOException e) { 101 // e.printStackTrace(); 102 // } 103 // 104 // } 105 106 public static void main(String[] args) { 107 108 try { 109 UIManager.setLookAndFeel(new NimbusLookAndFeel()); 110 } catch (UnsupportedLookAndFeelException e) { 111 // TODO Auto-generated catch block 112 e.printStackTrace(); 113 } 114 JFrame frame = new JFrame(); 115 //frame.add(new CommentPanel(new Color(20, 50, 110), "haha", "hihi", "date")); 116 frame.add(new CommentPanel(new Color(0, 153, 255), "haha", "hihi", "date")); 117 frame.pack(); 118 frame.setLocationRelativeTo(null); 119 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 120 frame.setVisible(true); 121 } 79 122 } -
extensions/jiwigo/trunk/src/main/java/fr/mael/jiwigo/ui/comments/CommentsDialog.java
r10697 r10701 24 24 import fr.mael.jiwigo.transverse.util.spring.SpringUtils; 25 25 import fr.mael.jiwigo.ui.browser.BrowserPanel; 26 import fr.mael.jiwigo.ui.mainframe.MainFrame; 26 27 27 28 /** … … 100 101 */ 101 102 public CommentsDialog(BrowserPanel parent, Integer imageId) { 102 // super(parent);103 super(MainFrame.getInstance()); 103 104 this.imageId = imageId; 104 105 this.setTitle(Messages.getMessage("commentaires")); … … 123 124 List<Comment> commentsForImage = SpringUtils.getCommentService().list(imageId); 124 125 GridBagConstraints c = new GridBagConstraints(); 126 125 127 c.insets = new Insets(3, 3, 3, 3); 126 128 c.gridx = 0; … … 130 132 CommentPanel panel; 131 133 if (alternate) { 132 panel = new CommentPanel(new Color( 153, 204, 51), comment.getContent(), comment.getAuthor(),134 panel = new CommentPanel(new Color(0, 153, 255), comment.getContent(), comment.getAuthor(), 133 135 comment.getDate()); 134 136 } else { 135 panel = new CommentPanel(new Color( 77, 204, 51), comment.getContent(), comment.getAuthor(),137 panel = new CommentPanel(new Color(20, 50, 110), comment.getContent(), comment.getAuthor(), 136 138 comment.getDate()); 137 139 }
Note: See TracChangeset
for help on using the changeset viewer.