Skip to content
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 @@ -5687,7 +5687,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 @@ -1298,6 +1298,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,7 @@ 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 final Dimension BUTTON_SIZE = new Dimension(22, 22);

// layouts constraint
Expand Down Expand Up @@ -263,11 +264,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 @@ -372,7 +368,7 @@ private void buildGUI() {
String contents = annotation.getParent() != null ?
annotation.getParent().getContents() : "";
textArea = new JTextArea(contents != null ? contents : "");
textArea.setFont(new JLabel().getFont());
textArea.setFont(new JLabel().getFont().deriveFont(annotation.getTextAreaFontsize()));
textArea.setWrapStyleWord(true);
textArea.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(PopupAnnotation.BORDER_COLOR),
BorderFactory.createEmptyBorder(2, 2, 2, 2)));
Expand All @@ -385,20 +381,23 @@ private void buildGUI() {

// creation date
creationLabel = new JLabel();
creationLabel.setFont(new JLabel().getFont().deriveFont(annotation.getHeaderLabelsFontSize()));
refreshCreationLabel();
// title, user name.
String title = selectedMarkupAnnotation != null ?
selectedMarkupAnnotation.getFormattedTitleText() : "";
titleLabel = new JLabel(title);

// Setup color appearance values.
resetComponentColors();
titleLabel.setFont(new JLabel().getFont().deriveFont(annotation.getHeaderLabelsFontSize()));

// 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 @@ -1246,6 +1245,14 @@ public void setFontSize(float size) {
setHeaderLabelsFontSize(size);
}

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