Skip to content

Commit

Permalink
pcorlessGH-272 Improves annotation summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Tâche committed May 17, 2023
1 parent 508dc0f commit 3c7a436
Show file tree
Hide file tree
Showing 37 changed files with 5,389 additions and 1,074 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;

/**
Expand Down Expand Up @@ -356,6 +357,10 @@ public LocalDateTime asLocalDateTime() {
return LocalDateTime.of(y, m, d, h, min, sec);
}

public long toEpochSecond() {
return asLocalDateTime().atZone(ZoneId.systemDefault()).toEpochSecond();
}

/**
* Utility mehtod for parsing Adobe standard date format,
* (D:YYYYMMDDHHmmSSOHH'mm').
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5640,7 +5640,7 @@ public void propertyChange(PropertyChangeEvent evt) {
}
if (annotationSummaryFrame != null &&
annotationSummaryFrame.getAnnotationSummaryPanel() != null) {
annotationSummaryFrame.getAnnotationSummaryPanel().refreshDocumentInstance();
annotationSummaryFrame.refreshDocumentInstance();
}
break;
case PropertyConstants.DESTINATION_ADDED:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.awt.*;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.InputStream;
import java.net.URL;
import java.util.ResourceBundle;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyListener;
import java.beans.PropertyChangeSupport;


/**
Expand Down Expand Up @@ -230,4 +231,9 @@ public interface DocumentViewController {
void firePropertyChange(String event, int oldValue, int newValue);

void firePropertyChange(String event, Object oldValue, Object newValue);

/**
* @return The property change support for this controller
*/
PropertyChangeSupport getPropertyChangeSupport();
}
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,11 @@ public void firePropertyChange(String event, Object oldValue,
changes.firePropertyChange(event, oldValue, newValue);
}

@Override
public PropertyChangeSupport getPropertyChangeSupport() {
return changes;
}

public void addPropertyChangeListener(PropertyChangeListener l) {
changes.addPropertyChangeListener(l);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ public class PopupAnnotationComponent extends AbstractAnnotationComponent<PopupA
public static final int DEFAULT_WIDTH = 215;
public static final int DEFAULT_HEIGHT = 150;
public static final Color backgroundColor = new Color(252, 253, 227);
public static Color borderColor = new Color(153, 153, 153);

public static final Dimension BUTTON_SIZE = new Dimension(22, 22);

// layouts constraint
Expand Down Expand Up @@ -260,11 +262,6 @@ public void setBounds(int x, int y, int width, int height) {
super.setBounds(x, y, width, height);
}

@Override
public void setBounds(Rectangle r) {
setBounds(r.x, r.y, r.width, r.height);
}

@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Expand Down Expand Up @@ -388,14 +385,15 @@ private void buildGUI() {
selectedMarkupAnnotation.getFormattedTitleText() : "";
titleLabel = new JLabel(title);

// Setup color appearance values.
resetComponentColors();

// main layout panel
GridBagLayout layout = new GridBagLayout();
commentPanel = new JPanel(layout);
commentPanel.setBackground(popupBackgroundColor);
this.setLayout(new GridBagLayout());

// Setup color appearance values.
resetComponentColors();

/*
* Build search GUI
*/
Expand Down Expand Up @@ -1255,6 +1253,14 @@ public void setFontSize(float size) {
creationLabel.setFont(font);
}

public void setFontFamily(String family) {
final Font curFont = textArea.getFont();
final Font newFont = new Font(family, curFont.getStyle(), curFont.getSize());
textArea.setFont(newFont);
titleLabel.setFont(newFont);
creationLabel.setFont(newFont);
}

public int getFontSize() {
return textArea.getFont().getSize();
}
Expand Down
Loading

0 comments on commit 3c7a436

Please sign in to comment.