@ -57,6 +57,7 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
private UIButton imageChooseButton ;
private UIButton imageDeleteButton ;
private ImagePreviewPane imagePreviewPane ;
private JPanel imagePreviewOverlayPane ;
private UIButtonGroup < Integer > imageLocationPane ;
private UISpinner imagePaddingPane ;
@ -89,24 +90,24 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
deletableImagePreviewPane . setLayout ( null ) ;
deletableImagePreviewPane . setBorder ( new UIRoundedBorder ( UIConstants . LINE_COLOR , 1 , 5 ) ) ;
deletableImagePreviewPane . setPreferredSize ( new Dimension ( IMAGE_PREVIEW_SIZE , IMAGE_PREVIEW_SIZE ) ) ;
JPanel o verlayPane = new JPanel ( ) ;
o verlayPane. setPreferredSize ( new Dimension ( IMAGE_PREVIEW_SIZE - 2 , IMAGE_PREVIEW_SIZE - 2 ) ) ;
o verlayPane. setBackground ( IMAGE_PREVIEW_OVERLAY_COLOR ) ;
imagePreviewO verlayPane = new JPanel ( ) ;
imagePreviewO verlayPane. setPreferredSize ( new Dimension ( IMAGE_PREVIEW_SIZE - 2 , IMAGE_PREVIEW_SIZE - 2 ) ) ;
imagePreviewO verlayPane. setBackground ( IMAGE_PREVIEW_OVERLAY_COLOR ) ;
imagePreviewPane . setBounds ( 0 , 0 , IMAGE_PREVIEW_SIZE , IMAGE_PREVIEW_SIZE ) ;
o verlayPane. setBounds ( 1 , 1 , IMAGE_PREVIEW_SIZE - 2 , IMAGE_PREVIEW_SIZE - 2 ) ;
imagePreviewO verlayPane. setBounds ( 1 , 1 , IMAGE_PREVIEW_SIZE - 2 , IMAGE_PREVIEW_SIZE - 2 ) ;
imageDeleteButton . setBounds ( IMAGE_PREVIEW_SIZE - DELETE_BUTTON_SIZE , 0 , DELETE_BUTTON_SIZE , DELETE_BUTTON_SIZE ) ;
deletableImagePreviewPane . add ( imageDeleteButton , 0 ) ;
deletableImagePreviewPane . add ( o verlayPane, 1 ) ;
deletableImagePreviewPane . add ( imagePreviewO verlayPane, 1 ) ;
deletableImagePreviewPane . add ( imagePreviewPane , 2 ) ;
o verlayPane. setVisible ( false ) ;
imagePreviewO verlayPane. setVisible ( false ) ;
imageDeleteButton . setVisible ( false ) ;
imageDeleteButton . setEnabled ( false ) ;
deletableImagePreviewPane . addMouseListener ( new MouseAdapter ( ) {
@Override
public void mouseEntered ( MouseEvent e ) {
super . mouseEntered ( e ) ;
o verlayPane. setVisible ( true ) ;
imagePreviewO verlayPane. setVisible ( true ) ;
imageDeleteButton . setVisible ( true ) ;
imageDeleteButton . setEnabled ( true ) ;
}
@ -117,7 +118,7 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
int x = e . getX ( ) ;
int y = e . getY ( ) ;
if ( x < = 0 | | getWidth ( ) < = x | | y < = 0 | | y > = getHeight ( ) ) {
o verlayPane. setVisible ( false ) ;
imagePreviewO verlayPane. setVisible ( false ) ;
imageDeleteButton . setVisible ( false ) ;
imageDeleteButton . setEnabled ( false ) ;
}
@ -216,6 +217,9 @@ public class TitleInsetImagePane extends JPanel implements UIObserver {
imagePreviewPane . setImageWithSuffix ( null ) ;
imageLocationPane . setSelectedIndex ( DEFAULT_INSET_LOCATION_INDEX ) ;
imagePaddingPane . setValue ( DEFAULT_INSET_PADDING ) ;
imagePreviewOverlayPane . setVisible ( false ) ;
imageDeleteButton . setVisible ( false ) ;
imageDeleteButton . setEnabled ( false ) ;
getComponent ( 1 ) . setVisible ( false ) ;
fireStateChanged ( ) ;