diff --git a/core/core-awt/src/main/java/org/icepdf/core/SystemProperties.java b/core/core-awt/src/main/java/org/icepdf/core/SystemProperties.java new file mode 100644 index 000000000..4821f6803 --- /dev/null +++ b/core/core-awt/src/main/java/org/icepdf/core/SystemProperties.java @@ -0,0 +1,18 @@ +package org.icepdf.core; + +import org.icepdf.core.util.Defs; + +public final class SystemProperties { + //System properties + public static final String OS_NAME = Defs.sysProperty("os.name"); + public static final String JAVA_HOME = Defs.sysProperty("java.home"); + public static final String USER_NAME = Defs.sysProperty("user.name"); + + //ICEpdf-specifics + public static final boolean PRIVATE_PROPERTY_ENABLED = Defs.booleanProperty( + "org.icepdf.core.page.annotation.privateProperty.enabled", false); + public static final boolean USE_NFONT = Defs.sysPropertyBoolean("org.icepdf.core.useNFont", true); + + private SystemProperties() { + } +} diff --git a/core/core-awt/src/main/java/org/icepdf/core/pobjects/Page.java b/core/core-awt/src/main/java/org/icepdf/core/pobjects/Page.java index 8d958a9e3..40c0b262d 100644 --- a/core/core-awt/src/main/java/org/icepdf/core/pobjects/Page.java +++ b/core/core-awt/src/main/java/org/icepdf/core/pobjects/Page.java @@ -15,6 +15,7 @@ */ package org.icepdf.core.pobjects; +import org.icepdf.core.SystemProperties; import org.icepdf.core.events.*; import org.icepdf.core.io.SeekableInput; import org.icepdf.core.pobjects.annotations.Annotation; @@ -76,9 +77,6 @@ public class Page extends Dictionary { */ public static final float SELECTION_ALPHA = 0.3f; - public static boolean PRIVATE_PROPERTY_ENABLED = Defs.booleanProperty( - "org.icepdf.core.page.annotation.privateProperty.enabled", false); - // text selection colour public static Color selectionColor; @@ -206,8 +204,6 @@ public class Page extends Dictionary { // page has default rotation value private float pageRotation = 0; - private String userName = System.getProperty("user.name"); - private int pageIndex; private int imageCount; private boolean pageInitialized; @@ -341,13 +337,11 @@ else if (annotObj instanceof HashMap) { // HashMap lacks "Type"->"Annot" entry if (ref != null && a != null) { a.setPObjectReference(ref); a.init(); - } - if (PRIVATE_PROPERTY_ENABLED && a.getFlagPrivateContents()) { - // check to make sure we don't show an annotation if the username doesn't match the creator - if (a instanceof MarkupAnnotation) { + if (SystemProperties.PRIVATE_PROPERTY_ENABLED && a instanceof MarkupAnnotation && a.getFlagPrivateContents()) { + // check to make sure we don't show an annotation if the username doesn't match the creator MarkupAnnotation markupAnnotation = (MarkupAnnotation) a; String creator = markupAnnotation.getTitleText(); - if (creator.equals(userName)) { + if (creator.equals(SystemProperties.USER_NAME)) { annotations.add(a); } else { // other wise we skip it all together but make sure the popup is hidden. @@ -355,10 +349,11 @@ else if (annotObj instanceof HashMap) { // HashMap lacks "Type"->"Annot" entry markupAnnotation.getPopupAnnotation().setOpen(false); } } + + } else { + // add any found annotations to the vector. + annotations.add(a); } - } else { - // add any found annotations to the vector. - annotations.add(a); } } catch (IllegalStateException e) { logger.warning("Malformed annotation could not be initialized. " + diff --git a/core/core-awt/src/main/java/org/icepdf/core/pobjects/acroform/signature/AbstractPkcsValidator.java b/core/core-awt/src/main/java/org/icepdf/core/pobjects/acroform/signature/AbstractPkcsValidator.java index fbc3ef8f6..fa7cf59e0 100644 --- a/core/core-awt/src/main/java/org/icepdf/core/pobjects/acroform/signature/AbstractPkcsValidator.java +++ b/core/core-awt/src/main/java/org/icepdf/core/pobjects/acroform/signature/AbstractPkcsValidator.java @@ -21,6 +21,7 @@ import org.bouncycastle.asn1.cms.ContentInfo; import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; import org.bouncycastle.tsp.TimeStampToken; +import org.icepdf.core.SystemProperties; import org.icepdf.core.io.SeekableInput; import org.icepdf.core.pobjects.Name; import org.icepdf.core.pobjects.acroform.SignatureDictionary; @@ -55,8 +56,8 @@ public abstract class AbstractPkcsValidator implements SignatureValidator { private static String caCertLocation = "/lib/security/cacerts"; static { - String javaHome = Defs.sysProperty("java.home"); - caCertLocation = Defs.sysProperty("org.icepdf.core.signatures.caCertPath", javaHome + caCertLocation); + caCertLocation = Defs.sysProperty("org.icepdf.core.signatures.caCertPath", + SystemProperties.JAVA_HOME + caCertLocation); } // data object descriptor codes. diff --git a/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontFactory.java b/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontFactory.java index fb4a9d392..815fd839d 100644 --- a/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontFactory.java +++ b/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontFactory.java @@ -15,6 +15,7 @@ */ package org.icepdf.core.pobjects.fonts; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.Stream; import org.icepdf.core.pobjects.fonts.ofont.OFont; import org.icepdf.core.util.Defs; @@ -42,14 +43,12 @@ public class FontFactory { // dynamic property to switch between font engine and awt font substitution. private static boolean awtFontSubstitution; - private static boolean useNFontIfAvailable; static { // turn on font file loading using awt, can cause the jvm to crash // if the font file is corrupt. awtFontLoading = Defs.sysPropertyBoolean("org.icepdf.core.awtFontLoading", true); - useNFontIfAvailable = Defs.sysPropertyBoolean("org.icepdf.core.useNFont", true); } public static final int FONT_OPEN_TYPE = 5; @@ -313,7 +312,7 @@ public static boolean foundFontEngine() { // keep quiet } - return foundNFont && !awtFontSubstitution && useNFontIfAvailable; + return foundNFont && !awtFontSubstitution && SystemProperties.USE_NFONT; } } diff --git a/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontManager.java b/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontManager.java index 005f1a0d8..6d072f3cb 100644 --- a/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontManager.java +++ b/core/core-awt/src/main/java/org/icepdf/core/pobjects/fonts/FontManager.java @@ -15,6 +15,7 @@ */ package org.icepdf.core.pobjects.fonts; +import org.icepdf.core.SystemProperties; import org.icepdf.core.util.Defs; import org.icepdf.core.util.FontUtil; @@ -136,7 +137,7 @@ public class FontManager { * Java base font class, generally ${java.home}\lib\fonts. This is the base font directory that is used * for searching for system fonts. If all else fails this should be the fall back directory. */ - public static String JAVA_FONT_PATH = Defs.sysProperty("java.home") + "/lib/fonts"; + public static String JAVA_FONT_PATH = SystemProperties.JAVA_HOME + "/lib/fonts"; /** * Default search path for fonts on windows systems. @@ -364,7 +365,7 @@ private synchronized void readSystemFonts(String[] extraFontPaths, boolean skipS ArrayList fontDirectories = new ArrayList<>(); // load the appropriate font set for the OS. if (!skipSystemFonts) { - String operationSystem = System.getProperty("os.name"); + String operationSystem = SystemProperties.OS_NAME; if (operationSystem != null) { operationSystem = operationSystem.toLowerCase(); if (operationSystem.contains("win")) { diff --git a/core/core-awt/src/main/java/org/icepdf/core/util/content/ContentParserFactory.java b/core/core-awt/src/main/java/org/icepdf/core/util/content/ContentParserFactory.java index e55f8fd3c..f9ad518d4 100644 --- a/core/core-awt/src/main/java/org/icepdf/core/util/content/ContentParserFactory.java +++ b/core/core-awt/src/main/java/org/icepdf/core/util/content/ContentParserFactory.java @@ -15,6 +15,7 @@ */ package org.icepdf.core.util.content; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.Resources; import org.icepdf.core.util.Defs; import org.icepdf.core.util.Library; @@ -45,7 +46,7 @@ public class ContentParserFactory { // check class bath for NFont library, and declare results. try { Class.forName(N_CONTENT_PARSER); - foundPro = Defs.sysPropertyBoolean("org.icepdf.core.useNFont", true); + foundPro = SystemProperties.USE_NFONT; } catch (ClassNotFoundException e) { logger.log(Level.FINE, "ICEpdf PRO was not found on the class path"); } diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingController.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingController.java index e2739d7db..0cabe2829 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingController.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingController.java @@ -16,6 +16,7 @@ package org.icepdf.ri.common; import org.icepdf.core.SecurityCallback; +import org.icepdf.core.SystemProperties; import org.icepdf.core.exceptions.PDFException; import org.icepdf.core.exceptions.PDFSecurityException; import org.icepdf.core.io.SizeInputStream; @@ -1876,11 +1877,12 @@ private void setAnnotationPrivacy(boolean isPublic) { private void reflectAnnotationDefaultPrivacy() { // check properties to get last state. Preferences preferences = ViewerPropertiesManager.getInstance().getPreferences(); - boolean annotationPrivacy = preferences.getBoolean( - ViewerPropertiesManager.PROPERTY_ANNOTATION_LAST_USED_PUBLIC_FLAG, true); + boolean annotationPrivacy = !SystemProperties.PRIVATE_PROPERTY_ENABLED || + preferences.getBoolean(ViewerPropertiesManager.PROPERTY_ANNOTATION_LAST_USED_PUBLIC_FLAG, true); + // store the current state in the model and annotation tool handlers will pull from the current state. - viewModel.setAnnotationPrivacy(annotationPrivacy); + setAnnotationPrivacy(annotationPrivacy); // set the default value of the combo box. if (annotationPrivacyComboBox != null) { diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingViewBuilder.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingViewBuilder.java index dd7949a48..6f87a293f 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingViewBuilder.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/SwingViewBuilder.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.Page; import org.icepdf.core.pobjects.graphics.images.references.ImageReference; import org.icepdf.core.pobjects.graphics.images.references.ImageReferenceFactory; @@ -308,7 +309,7 @@ public class SwingViewBuilder { private static boolean isDemo; static { - isMacOs = Defs.sysProperty("os.name").contains("OS X"); + isMacOs = SystemProperties.OS_NAME.contains("OS X"); // check for demo system property isDemo = Defs.sysPropertyBoolean("org.icepdf.ri.viewer.demo", false); } @@ -1609,7 +1610,7 @@ public JToolBar buildAnnotationlToolBar() { ViewerPropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION_TEXT)) { addToToolBar(toolbar, buildTextAnnotationToolButton(iconSize)); } - if (propertiesManager.checkAndStoreBooleanProperty( + if (SystemProperties.PRIVATE_PROPERTY_ENABLED && propertiesManager.checkAndStoreBooleanProperty( ViewerPropertiesManager.PROPERTY_SHOW_TOOLBAR_ANNOTATION_PERMISSION)) { addToToolBar(toolbar, buildAnnotationPermissionCombBox()); } diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/CircleAnnotationHandler.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/CircleAnnotationHandler.java index 8316f4261..846c7c389 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/CircleAnnotationHandler.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/CircleAnnotationHandler.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.tools; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.annotations.Annotation; import org.icepdf.core.pobjects.annotations.AnnotationFactory; @@ -188,7 +189,7 @@ public void mouseReleased(MouseEvent e) { checkAndApplyPreferences(); annotation.setCreationDate(PDate.formatDateTime(new Date())); - annotation.setTitleText(System.getProperty("user.name")); + annotation.setTitleText(SystemProperties.USER_NAME); annotation.setColor(lineColor); annotation.setOpacity(defaultOpacity); if (annotation.isFillColor() || useInternalColor) { diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/FreeTextAnnotationHandler.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/FreeTextAnnotationHandler.java index 7ce1daf4c..0117d4dee 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/FreeTextAnnotationHandler.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/FreeTextAnnotationHandler.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.tools; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.annotations.Annotation; import org.icepdf.core.pobjects.annotations.AnnotationFactory; @@ -124,7 +125,7 @@ public void createFreeTextAnnotation(int x, int y, boolean setSelectionTool) { annotation.setFlag(Annotation.FLAG_PRIVATE_CONTENTS, !viewModel.getAnnotationPrivacy()); annotation.setCreationDate(PDate.formatDateTime(new Date())); - annotation.setTitleText(System.getProperty("user.name")); + annotation.setTitleText(SystemProperties.USER_NAME); annotation.setContents(""); // apply store settings diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/HighLightAnnotationHandler.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/HighLightAnnotationHandler.java index 916f12eda..b7cc35fcd 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/HighLightAnnotationHandler.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/HighLightAnnotationHandler.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.tools; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.Name; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.Page; @@ -176,7 +177,7 @@ public void createTextMarkupAnnotation(ArrayList highlightBounds) { // before assigning the default colour check to see if there is an entry in the properties manager checkAndApplyPreferences(); annotation.setCreationDate(PDate.formatDateTime(new Date())); - annotation.setTitleText(System.getProperty("user.name")); + annotation.setTitleText(SystemProperties.USER_NAME); annotation.setMarkupBounds(highlightBounds); annotation.setMarkupPath(highlightPath); annotation.setBBox(tBbox); diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/InkAnnotationHandler.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/InkAnnotationHandler.java index 9320dab2d..7863aeca4 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/InkAnnotationHandler.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/InkAnnotationHandler.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.tools; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.annotations.Annotation; import org.icepdf.core.pobjects.annotations.AnnotationFactory; @@ -167,7 +168,7 @@ public void mouseReleased(MouseEvent e) { checkAndApplyPreferences(); annotation.setCreationDate(PDate.formatDateTime(new Date())); - annotation.setTitleText(System.getProperty("user.name")); + annotation.setTitleText(SystemProperties.USER_NAME); annotation.setColor(inkColor); annotation.setBorderStyle(borderStyle); annotation.setInkPath(tInkPath); diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/LineAnnotationHandler.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/LineAnnotationHandler.java index 453e12c5f..aacb2a9ec 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/LineAnnotationHandler.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/LineAnnotationHandler.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.tools; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.Name; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.annotations.Annotation; @@ -200,7 +201,7 @@ public void mouseReleased(MouseEvent e) { // setup the markup properties. annotation.setContents(annotation.getSubType().toString()); annotation.setCreationDate(PDate.formatDateTime(new Date())); - annotation.setTitleText(System.getProperty("user.name")); + annotation.setTitleText(SystemProperties.USER_NAME); // pass outline shapes and bounds to create the highlight shapes annotation.setBBox(tBbox); diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/SquareAnnotationHandler.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/SquareAnnotationHandler.java index 7c67620b5..68644ca0d 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/SquareAnnotationHandler.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/SquareAnnotationHandler.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.tools; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.annotations.Annotation; import org.icepdf.core.pobjects.annotations.AnnotationFactory; @@ -194,7 +195,7 @@ public void mouseReleased(MouseEvent e) { ViewModel viewModel = documentViewController.getParentController().getViewModel(); annotation.setFlag(Annotation.FLAG_PRIVATE_CONTENTS, !viewModel.getAnnotationPrivacy()); annotation.setCreationDate(PDate.formatDateTime(new Date())); - annotation.setTitleText(System.getProperty("user.name")); + annotation.setTitleText(SystemProperties.USER_NAME); annotation.setColor(lineColor); annotation.setOpacity(defaultOpacity); diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/TextAnnotationHandler.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/TextAnnotationHandler.java index e3434329a..6bb5f5229 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/TextAnnotationHandler.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/tools/TextAnnotationHandler.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.tools; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.Name; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.PObject; @@ -117,7 +118,7 @@ public static TextAnnotation createTextAnnotation(Library library, Rectangle bbo Annotation.SUBTYPE_TEXT, bbox); textAnnotation.setCreationDate(PDate.formatDateTime(new Date())); - textAnnotation.setTitleText(System.getProperty("user.name")); + textAnnotation.setTitleText(SystemProperties.USER_NAME); textAnnotation.setContents(""); diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/AnnotationCellRender.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/AnnotationCellRender.java index 21cd8ff48..535ce7982 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/AnnotationCellRender.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/AnnotationCellRender.java @@ -28,6 +28,8 @@ import java.awt.geom.AffineTransform; import java.awt.geom.GeneralPath; +import static org.icepdf.core.SystemProperties.PRIVATE_PROPERTY_ENABLED; + /** * AnnotationCellRender takes care of building a tree node's appearance for annotation nodes. If an annotation type * is not supported by the editing tools an icon for the note is set to null. @@ -247,7 +249,7 @@ public Component getTreeCellRendererComponent( setClosedIcon(new ImageIcon(Images.get("page.gif"))); setLeafIcon(new ImageIcon(Images.get("page.gif"))); } - if (MarkupAnnotationPanel.PRIVATE_PROPERTY_ENABLED && annotation != null) { + if (PRIVATE_PROPERTY_ENABLED && annotation != null) { final ImageIcon privateIcon; privateIcon = annotation.getFlagPrivateContents() ? new ImageIcon(Images.get("lock_16.png")) : diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/FindMarkupAnnotationTask.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/FindMarkupAnnotationTask.java index 80476693b..358bdefbc 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/FindMarkupAnnotationTask.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/FindMarkupAnnotationTask.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.utility.annotation.markup; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.Document; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.Page; @@ -38,6 +39,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.icepdf.core.SystemProperties.PRIVATE_PROPERTY_ENABLED; + public class FindMarkupAnnotationTask extends AbstractTask { private static final Logger logger = @@ -131,7 +134,7 @@ protected Void doInBackground() { } taskStatusMessage = loadingMessage.format(new Object[]{i + 1, pageCount}); taskProgress = i; - String userName = System.getProperty("user.name"); + String userName = SystemProperties.USER_NAME; Page page = currentDocument.getPageTree().getPage(i); if (page != null) { ArrayList annotationReferences = page.getAnnotationReferences(); @@ -178,7 +181,7 @@ protected Void doInBackground() { filter = true; } } - if (MarkupAnnotationPanel.PRIVATE_PROPERTY_ENABLED && + if (PRIVATE_PROPERTY_ENABLED && filterVisibility != MarkupAnnotationPanel.FilterVisibilityColumn.ALL) { if ((markupAnnotation.getFlagPrivateContents() && filterVisibility == MarkupAnnotationPanel.FilterVisibilityColumn.PUBLIC) diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/MarkupAnnotationPanel.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/MarkupAnnotationPanel.java index 04ee1dbf5..929390177 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/MarkupAnnotationPanel.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/annotation/markup/MarkupAnnotationPanel.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.utility.annotation.markup; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.annotations.*; import org.icepdf.core.util.Defs; import org.icepdf.core.util.PropertyConstants; @@ -41,6 +42,7 @@ import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; +import static org.icepdf.core.SystemProperties.PRIVATE_PROPERTY_ENABLED; import static org.icepdf.ri.util.ViewerPropertiesManager.PROPERTY_SEARCH_MARKUP_PANEL_CASE_SENSITIVE_ENABLED; import static org.icepdf.ri.util.ViewerPropertiesManager.PROPERTY_SEARCH_MARKUP_PANEL_REGEX_ENABLED; @@ -57,13 +59,6 @@ public class MarkupAnnotationPanel extends JPanel implements ActionListener, Pro private static final Logger logger = Logger.getLogger(MarkupAnnotationPanel.class.toString()); - public static boolean PRIVATE_PROPERTY_ENABLED; - - static { - PRIVATE_PROPERTY_ENABLED = Defs.booleanProperty( - "org.icepdf.core.page.annotation.privateProperty.enabled", false); - } - public static final String COLUMN_PROPERTY = "Column"; public enum SortColumn {PAGE, AUTHOR, DATE, TYPE, COLOR, VISIBILITY} diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/MarkupAnnotationComponent.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/MarkupAnnotationComponent.java index 942b97ccf..2cc343c2e 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/MarkupAnnotationComponent.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/MarkupAnnotationComponent.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.views.annotations; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.Reference; import org.icepdf.core.pobjects.annotations.MarkupAnnotation; @@ -151,7 +152,7 @@ public PopupAnnotationComponent createPopupAnnotationComponent(boolean isNew) { annotation.setCreationDate(PDate.formatDateTime(new Date())); } if (annotation.getTitleText() == null) { - annotation.setTitleText(System.getProperty("user.name")); + annotation.setTitleText(SystemProperties.USER_NAME); } if (annotation.getContents() == null) { annotation.setContents(""); diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/PopupAnnotationComponent.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/PopupAnnotationComponent.java index 041cad1fe..475c70d8a 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/PopupAnnotationComponent.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/views/annotations/PopupAnnotationComponent.java @@ -15,6 +15,7 @@ */ package org.icepdf.ri.common.views.annotations; +import org.icepdf.core.SystemProperties; import org.icepdf.core.pobjects.PDate; import org.icepdf.core.pobjects.Reference; import org.icepdf.core.pobjects.annotations.Annotation; @@ -90,13 +91,6 @@ public class PopupAnnotationComponent extends AbstractAnnotationComponent