private void setNonStrokingColorSpaceStack(PDColorSpace colorSpace) { if (nonStrokingColorSpaceStack.isEmpty()) { nonStrokingColorSpaceStack.add(colorSpace); } else { nonStrokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1); } }
private void setStrokingColorSpaceStack(PDColorSpace colorSpace) { if (strokingColorSpaceStack.isEmpty()) { strokingColorSpaceStack.add(colorSpace); } else { strokingColorSpaceStack.setElementAt(colorSpace, strokingColorSpaceStack.size() - 1); } }
protected void setStrokingColorSpaceStack(PDColorSpace colorSpace) { if (strokingColorSpaceStack.isEmpty()) { strokingColorSpaceStack.add(colorSpace); } else { strokingColorSpaceStack.setElementAt(colorSpace, strokingColorSpaceStack.size() - 1); } }
protected void setNonStrokingColorSpaceStack(PDColorSpace colorSpace) { if (nonStrokingColorSpaceStack.isEmpty()) { nonStrokingColorSpaceStack.add(colorSpace); } else { nonStrokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1); } }
public void setStackParameter(String name, Object data) { Stack<Object> set = (Stack<Object>) getStackParameters().get(name); if (set == null || set.isEmpty()) { pushStackParameter(name, data); } else { set.setElementAt(data, set.size() - 1); } }
/** * In some cases an RtfContainer must be replaced by another one on the * stack. This happens when handling nested fo:blocks for example: after * handling a nested block the enclosing block must switch to a new * paragraph container to handle what follows the nested block. * TODO: what happens to elements that are "more on top" than oldC on the * stack? shouldn't they be closed or something? * @param oldC old container * @param newC new container * @throws Exception if not caught */ public void replaceContainer(RtfContainer oldC, RtfContainer newC) throws Exception { // treating the Stack as a Vector allows such manipulations (yes, I hear you screaming ;-) final int index = containers.indexOf(oldC); if (index < 0) { throw new Exception("container to replace not found:" + oldC); } containers.setElementAt(newC, index); }
public void add(Service S) { makeConsistent(S); // Get the actual vector index int mylevel = S.actualLevel; // Grow the stack if need be expand(mylevel); ArrayList v; if (stack.get(mylevel) == null) { v = new ArrayList(); v.add(S); stack.setElementAt(v, mylevel); } else { v = (ArrayList) stack.get(mylevel); v.add(S); } pr("Added " + S.toString()); }
/** * Set the stroking color space. This will add the colorspace to the PDResources * if necessary. * * @param colorSpace The colorspace to write. * @throws IOException If there is an error writing the colorspace. * @deprecated Use {@link #setNonStrokingColor} instead. */ @Deprecated public void setNonStrokingColorSpace(PDColorSpace colorSpace) throws IOException { if (nonStrokingColorSpaceStack.isEmpty()) { nonStrokingColorSpaceStack.add(colorSpace); } else { nonStrokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1); } writeOperand(getName(colorSpace)); writeOperator("cs"); }
public void add(Service S) { makeConsistent(S); // Get the actual vector index int mylevel = S.actualLevel; // Grow the stack if need be expand(mylevel); ArrayList v; if (stack.get(mylevel) == null) { v = new ArrayList(); v.add(S); stack.setElementAt(v, mylevel); } else { v = (ArrayList) stack.get(mylevel); v.add(S); } pr("Added " + S.toString()); }
/** * Set the stroking color space. This will add the colorspace to the PDResources * if necessary. * * @param colorSpace The colorspace to write. * @throws IOException If there is an error writing the colorspace. * @deprecated Use {@link #setStrokingColor} instead. */ @Deprecated public void setStrokingColorSpace(PDColorSpace colorSpace) throws IOException { if (strokingColorSpaceStack.isEmpty()) { strokingColorSpaceStack.add(colorSpace); } else { strokingColorSpaceStack.setElementAt(colorSpace, nonStrokingColorSpaceStack.size() - 1); } writeOperand(getName(colorSpace)); writeOperator("CS"); }
/** * Set the font and font size to draw text with. * * @param font The font to use. * @param fontSize The font size to draw the text. * @throws IOException If there is an error writing the font information. */ public void setFont(PDFont font, float fontSize) throws IOException { if (fontStack.isEmpty()) { fontStack.add(font); } else { fontStack.setElementAt(font, fontStack.size() - 1); } writeOperand(resources.add(font)); writeOperand(fontSize); writeOperator("Tf"); }
/** * Set the font and font size to draw text with. * * @param font The font to use. * @param fontSize The font size to draw the text. * @throws IOException If there is an error writing the font information. */ public void setFont(PDFont font, float fontSize) throws IOException { if (fontStack.isEmpty()) { fontStack.add(font); } else { fontStack.setElementAt(font, fontStack.size() - 1); } if (font.willBeSubset()) { document.getFontsToSubset().add(font); } writeOperand(resources.add(font)); writeOperand(fontSize); writeOperator("Tf"); }
toplevel--; } else { stack.setElementAt(newlist, mylevel);
/** * Set the font to draw text with. * * @param font The font to use. * @param fontSize The font size to draw the text. * @throws IOException If there is an error writing the font information. */ public void setFont(PDFont font, float fontSize) throws IOException { if (fontStack.isEmpty()) { fontStack.add(font); } else { fontStack.setElementAt(font, fontStack.size() - 1); } if (font.willBeSubset() && !document.getFontsToSubset().contains(font)) { document.getFontsToSubset().add(font); } writeOperand(resources.add(font)); writeOperand(fontSize); writeOperator("Tf"); }
toplevel--; } else { stack.setElementAt(newlist, mylevel);
/** * Set the font and font size to draw text with. * * @param font The font to use. * @param fontSize The font size to draw the text. * @throws IOException If there is an error writing the font information. */ @Override public void setFont(PDFont font, float fontSize) throws IOException { if (fontStack.isEmpty()) { fontStack.add(font); } else { fontStack.setElementAt(font, fontStack.size() - 1); } if (font.willBeSubset()) { document.getFontsToSubset().add(font); } writeOperand(getResources().add(font)); writeOperand(fontSize); writeOperator("Tf"); }
strokingColorSpaceStack.setElementAt(color.getColorSpace(), nonStrokingColorSpaceStack.size() - 1);
nonStrokingColorSpaceStack.setElementAt(color.getColorSpace(), nonStrokingColorSpaceStack.size() - 1);
fix_itm.propagate_items().setElementAt(existing ,l);
fix_itm.propagate_items().setElementAt(existing ,l);