Resources.java :  » PDF » PDFClown-0.0.5 » it » stefanochizzolini » clown » documents » contents » Java Open Source

Java Open Source » PDF » PDFClown 0.0.5 
PDFClown 0.0.5 » it » stefanochizzolini » clown » documents » contents » Resources.java
/*
  Copyright  2006 Stefano Chizzolini. http://clown.stefanochizzolini.it

  Contributors:
    * Stefano Chizzolini (original code developer, http://www.stefanochizzolini.it):
      contributed code is Copyright  2006 by Stefano Chizzolini.

  This file should be part of the source code distribution of "PDF Clown library"
  (the Program): see the accompanying README files for more info.

  This Program is free software; you can redistribute it and/or modify it under
  the terms of the GNU General Public License as published by the Free Software
  Foundation; either version 2 of the License, or (at your option) any later version.

  This Program is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY, either expressed or implied; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more details.

  You should have received a copy of the GNU General Public License along with this
  Program (see README files); if not, go to the GNU website (http://www.gnu.org/).

  Redistribution and use, with or without modification, are permitted provided that such
  redistributions retain the above copyright notice, license and disclaimer, along with
  this list of conditions.
*/

package it.stefanochizzolini.clown.documents.contents;

import it.stefanochizzolini.clown.documents.Document;
import it.stefanochizzolini.clown.objects.PdfDictionary;
import it.stefanochizzolini.clown.objects.PdfDirectObject;
import it.stefanochizzolini.clown.objects.PdfIndirectObject;
import it.stefanochizzolini.clown.objects.PdfName;
import it.stefanochizzolini.clown.objects.PdfObjectWrapper;
import it.stefanochizzolini.clown.util.NotImplementedException;

/**
  Resources collection [PDF:1.6:3.7.2].
*/
public class Resources
  extends PdfObjectWrapper<PdfDictionary>
{
  // <class>
  // <dynamic>
  // <constructors>
  public Resources(
    Document context
    )
  {
    super(
      context.getFile(),
      new PdfDictionary()
      );
  }

  /**
    <h3>Remarks</h3>
    <p>For internal use only.</p>
  */
  public Resources(
    PdfDirectObject baseObject,
    PdfIndirectObject container
    )
  {
    super(
      baseObject,
      container
      );
  }
  // </constructors>

  // <interface>
  // <public>
  @Override
  public Resources clone(
    Document context
    )
  {throw new NotImplementedException();}

  public ColorSpaces getColorSpaces(
    )
  {
    /*
      NOTE: ColorSpace entry may be undefined [PDF:1.6:3.7.2].
    */
    PdfDirectObject colorSpaces = getBaseDataObject().get(PdfName.ColorSpace);
    if(colorSpaces == null)
      return null;
    else
      return new ColorSpaces(
        colorSpaces,
        getContainer()
        );
  }

  public Fonts getFonts(
    )
  {
    /*
      NOTE: Font entry may be undefined [PDF:1.6:3.7.2].
    */
    PdfDirectObject fonts = getBaseDataObject().get(PdfName.Font);
    if(fonts == null)
      return null;
    else
      return new Fonts(
        fonts,
        getContainer()
        );
  }

  public XObjects getXObjects(
    )
  {
    /*
      NOTE: XObject entry may be undefined [PDF:1.6:3.7.2].
    */
    PdfDirectObject xObjects = getBaseDataObject().get(PdfName.XObject);
    if(xObjects == null)
      return null;
    else
      return new XObjects(
        xObjects,
        getContainer()
        );
  }

  public void setColorSpaces(
    ColorSpaces value
    )
  {getBaseDataObject().put(PdfName.ColorSpace,value.getBaseObject());}

  public void setFonts(
    Fonts value
    )
  {getBaseDataObject().put(PdfName.Font,value.getBaseObject());}

  public void setXObjects(
    XObjects value
    )
  {getBaseDataObject().put(PdfName.XObject,value.getBaseObject());}
  // </public>
  // </interface>
  // </dynamic>
  // </class>
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.