/** * Applies the properties of the Anchor to a Chunk. * @param chunk the Chunk (part of the Anchor) * @param notGotoOK if true, this chunk will determine the local destination * @param localDestination true if the chunk is a local goto and the reference a local destination * @return the value of notGotoOK or false, if a previous Chunk was used to determine the local destination */ protected boolean applyAnchor(Chunk chunk, boolean notGotoOK, boolean localDestination) { if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false; } if (localDestination) { chunk.setLocalGoto(reference.substring(1)); } else if (reference != null) chunk.setAnchor(reference); return notGotoOK; }
while (i.hasNext()) { chunk = i.next(); if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false;
/** * Applies the properties of the Anchor to a Chunk. * @param chunk the Chunk (part of the Anchor) * @param notGotoOK if true, this chunk will determine the local destination * @param localDestination true if the chunk is a local goto and the reference a local destination * @return the value of notGotoOK or false, if a previous Chunk was used to determine the local destination */ protected boolean applyAnchor(Chunk chunk, boolean notGotoOK, boolean localDestination) { if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false; } if (localDestination) { chunk.setLocalGoto(reference.substring(1)); } else if (reference != null) chunk.setAnchor(reference); return notGotoOK; }
while (i.hasNext()) { chunk = i.next(); if (name != null && notGotoOK && !chunk.isEmpty()) { chunk.setLocalDestination(name); notGotoOK = false;
/** * Checks is this <CODE>Phrase</CODE> contains no or 1 empty <CODE>Chunk</CODE>. * * @return <CODE>false</CODE> if the <CODE>Phrase</CODE> * contains more than one or more non-empty<CODE>Chunk</CODE>s. */ @Override public boolean isEmpty() { switch(size()) { case 0: return true; case 1: Element element = get(0); if (element.type() == Element.CHUNK && ((Chunk) element).isEmpty()) { return true; } return false; default: return false; } }
/** * Checks is this <CODE>Phrase</CODE> contains no or 1 empty <CODE>Chunk</CODE>. * * @return <CODE>false</CODE> if the <CODE>Phrase</CODE> * contains more than one or more non-empty<CODE>Chunk</CODE>s. */ @Override public boolean isEmpty() { switch(size()) { case 0: return true; case 1: Element element = get(0); if (element.type() == Element.CHUNK && ((Chunk) element).isEmpty()) { return true; } return false; default: return false; } }
chunk.setFont(font.difference(chunk.getFont())); if (hyphenation != null && chunk.getHyphenation() == null && !chunk.isEmpty()) { chunk.setHyphenation(hyphenation);
chunk.setFont(font.difference(chunk.getFont())); if (hyphenation != null && chunk.getHyphenation() == null && !chunk.isEmpty()) { chunk.setHyphenation(hyphenation);
newChunk.role = chunk.getRole(); newChunk.accessibleAttributes = chunk.getAccessibleAttributes(); if (hyphenation != null && newChunk.getHyphenation() == null && !newChunk.isEmpty()) { newChunk.setHyphenation(hyphenation);
newChunk.role = chunk.getRole(); newChunk.accessibleAttributes = chunk.getAccessibleAttributes(); if (hyphenation != null && newChunk.getHyphenation() == null && !newChunk.isEmpty()) { newChunk.setHyphenation(hyphenation);