Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5cbdc22
GH-25 Don't ask the user to save if no changes have been made since l…
gtache Feb 6, 2020
572c514
GH-42 Implements save with same name on Ctrl+S
gtache Feb 7, 2020
9ff6962
Adds timer at document open to get initial changes
gtache Feb 7, 2020
97c31ac
Merge branch 'saveOnClose' into simpleSave
gtache Feb 7, 2020
8ded3a1
Reverts pom.xml
gtache Feb 7, 2020
a0fe15e
Merge branch 'saveOnClose' into simpleSave
gtache Feb 7, 2020
2f91945
Fixes conflict with PropertiesManager renaming
gtache Feb 12, 2020
766d16a
GH-25 Fixes conflicts
gtache Feb 12, 2020
a5266d7
GH-42 Fixes conflicts
gtache Feb 12, 2020
c8dc580
GH-46 Adds Webdav support
gtache Feb 13, 2020
2c42a70
GH-46 Sets password null by default
gtache Feb 13, 2020
07516f7
GH-42 Fixes error on close if document is null
gtache Feb 14, 2020
693213f
Merge branch 'master' of github.com:pcorless/icepdf
gtache Feb 17, 2020
db0b33f
Merge branch 'master' of github.com:pcorless/icepdf
gtache Feb 28, 2020
eb63280
Reformats MessageBundles
gtache Feb 28, 2020
41b2a05
Fix conflict
gtache Feb 28, 2020
5a195d6
Reformat properties
gtache Feb 28, 2020
2ab6808
Fix conflict
gtache Feb 28, 2020
2ee64ee
Merge branch 'master' into saveOnClose
gtache Feb 28, 2020
d26ae25
GH-25 Takes updated pobjects into account
gtache May 11, 2020
a4b0f97
Merge branch 'master' of github.com:pcorless/icepdf
gtache May 12, 2020
f3f99cd
Merge branch 'master' of github.com:pcorless/icepdf
gtache May 14, 2020
bb093da
Updates dav handling
gtache May 28, 2020
2df7fe7
Fixes conflicts
gtache May 28, 2020
b8ba908
Fixes conflicts
gtache May 28, 2020
e833d93
Fix conflicts
gtache May 28, 2020
278a072
GH-94 Extracts common System.getProperty to SystemProperties class
gtache May 29, 2020
b70d920
GH-94 Adds check for PRIVATE_PROPERTY_ENABLED for annotationPermissio…
gtache May 29, 2020
94f07f8
GH-94 Sets annotation visibility to public when PRIVATE_PROPERTY_ENAB…
gtache May 29, 2020
065e40d
GH-46 Sets username to user.name by default
gtache May 29, 2020
61923fd
GH-94 Also checks for a==null in Page
gtache Jun 2, 2020
623334d
GH-94 Don't add annotation if a=null
gtache Jun 2, 2020
eca0af0
GH-46 Lets user set username
gtache Jun 3, 2020
ddd89c2
GH-46 Adds open WebDav URL menu item
gtache Jun 3, 2020
075ba70
GH-104 Adds lines to messagebundle
gtache Jun 8, 2020
db7f370
Merge branch 'davSupport' into chooseFont
gtache Jun 8, 2020
ea09a37
GH-104 Allows the user to select OFont or NFont
gtache Jun 8, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions core/core-awt/src/main/java/org/icepdf/core/SystemProperties.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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 boolean USE_NFONT = Defs.sysPropertyBoolean("org.icepdf.core.useNFont", true);

private SystemProperties() {
}

public static void setUseNFont(boolean useNFont) {
USE_NFONT = useNFont;
}
}
21 changes: 8 additions & 13 deletions core/core-awt/src/main/java/org/icepdf/core/pobjects/Page.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -341,24 +337,23 @@ 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.
if (markupAnnotation.getPopupAnnotation() != null) {
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. " +
Expand Down
Loading