@Test
  public void executeWithSEOInGallery() throws IOException, ServletException {
    final Site site = TestUtil.createSite();
    final PageManager pageVersion = new PageManager(TestUtil.createPage(site));
    final Gallery gallery = TestUtil.createGallery(site);
    final WidgetItem galleryWidget = TestUtil.createWidgetItem();
    galleryWidget.setDraftItem((DraftItem) gallery);
    pageVersion.addWidget(galleryWidget);

    final DraftForm galleryForm = TestUtil.createCustomForm(site);
    TestUtil.createFormItem(FormItemName.SEO_KEYWORDS, galleryForm, 0);

    gallery.setFormId1(galleryForm.getFormId());

    final FilledForm filledForm = TestUtil.createFilledForm(galleryForm);
    final FilledFormItem filledFormItem = TestUtil.createFilledFormItem(FormItemName.SEO_KEYWORDS);
    filledFormItem.setValue("seo1;seo2;seo3");
    filledForm.addFilledFormItem(filledFormItem);

    stringBuilder.append("<!-- PAGE_HEADER -->");

    MockHttpServletRequest mockRequest = new MockHttpServletRequest("", "");
    mockRequest.setAttribute(
        "currentDisplayedFilledFormId" + gallery.getId(), filledForm.getFilledFormId());
    RenderContext context = new RenderContext(mockRequest, null, null, null, false);

    final Render render = new RenderKeywordsMetaTags(pageVersion, SiteShowOption.ON_USER_PAGES);
    render.execute(context, stringBuilder);

    Assert.assertEquals(
        "<meta name=\"keywords\" content=\"seo1, seo2, seo3\">\n" + "<!-- PAGE_HEADER -->",
        stringBuilder.toString());
  }
Example #2
0
  /**
   * Renders the specified entity with the passed in position, yaw, and partialTickTime. Args:
   * entity, x, y, z, yaw, partialTickTime
   */
  public void renderEntityWithPosYaw(
      Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
    Render var10 = this.getEntityRenderObject(par1Entity);

    if (var10 != null) {
      var10.doRender(par1Entity, par2, par4, par6, par8, par9);
      var10.doRenderShadowAndFire(par1Entity, par2, par4, par6, par8, par9);
    }
  }
Example #3
0
  public Render getRender() {
    Render r = new Render();
    r.x = x;
    r.y = y;

    if (image == null) {
      image = Util.loadImage("lib/pipe-" + orientation + ".png");
    }
    r.image = image;

    return r;
  }
Example #4
0
  @Override
  public void render(float deltaTime) {
    super.render(deltaTime);

    float angle = m_theBoard.getAngle();

    float x = m_theBoard.getPosition().x;
    float y = m_theBoard.getPosition().y;

    TextureRegion texBoard = new TextureRegion(Resources.m_texBoard);

    Render.draw(texBoard, x - 2, y - 0.2f, 2 * 2, 0.2f * 2, angle);

    TextureRegion texBall = null;
    float width = 0.4f;
    float height = 0.4f;

    angle = m_theBall.getAngle();
    x = m_theBall.getPosition().x;
    y = m_theBall.getPosition().y;

    if (m_bIsBombed) {
      texBall = m_animaBomb.getKeyFrame(m_bombFrameDuration, true);
      width = 0.6f;
      height = 0.6f;
    } else {
      if (Settings.LEVEL == Settings.LEVEL_METAL_BALL) {
        texBall = new TextureRegion(Resources.m_texMetal);
      } else if (Settings.LEVEL == Settings.LEVEL_PINGPANG_BALL) {
        texBall = new TextureRegion(Resources.m_texPingpang);
      } else if (Settings.LEVEL == Settings.LEVEL_RUBBER_BALL) {
        texBall = new TextureRegion(Resources.m_texRabber);
      }
    }

    Render.draw(texBall, x - 0.2f, y - 0.2f, width, height, angle);

    TextureRegion texF = new TextureRegion(Resources.m_texFulcrum);
    x = m_theFulcrum.getPosition().x;
    y = m_theFulcrum.getPosition().y;
    Render.draw(texF, x - 0.15f, y - 0.3f, 0.3f, 0.3f);
  }
Example #5
0
 public Aplicacao(String s) {
   setSize(600, 320);
   setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   setLocationRelativeTo(null);
   setUndecorated(true);
   Personagem p1;
   try {
     p1 = new Personagem(0, 175, s);
     ArrayList<Monstro> m = new ArrayList<Monstro>();
     ArrayList<Item> i = new ArrayList<Item>();
     Render render = new Render(p1, m, i);
     Logica logica = new Logica(p1, m, render, i);
     render.addKeyListener(new TratarTeclas(p1));
     render.addMouseListener(new TratarMouse(p1));
     logica.start();
     add(render);
   } catch (IOException e) {
     e.printStackTrace();
   }
   setVisible(true);
 }
Example #6
0
  public void init(Constants constants, ServletContext servletContext) {
    this.constants = constants;
    RenderFactory.servletContext = servletContext;

    // init Render
    Render.init(constants.getEncoding(), constants.getDevMode());
    initFreeMarkerRender(servletContext);
    initVelocityRender(servletContext);
    initFileRender(servletContext);

    // create mainRenderFactory
    if (mainRenderFactory == null) {
      ViewType defaultViewType = constants.getViewType();
      if (defaultViewType == ViewType.FREE_MARKER)
        mainRenderFactory = new FreeMarkerRenderFactory();
      else if (defaultViewType == ViewType.JSP) mainRenderFactory = new JspRenderFactory();
      else if (defaultViewType == ViewType.VELOCITY)
        mainRenderFactory = new VelocityRenderFactory();
      else throw new RuntimeException("View Type can not be null.");
    }
  }
  public static void iterate() {
    // Dealing with the user input

    UserInterface.iterate();
    UserInterface soul = new UserInterface();
    soul.update(getPlayerEntity());

    // Dealing with the Camera
    WorldShapes.setCamera(mainCamera);
    mainCamera.setZoom(mainCamera.getZoom() * Math.pow(1.001, Mouse.getDWheel()));
    mainCamera.followParticle(mainCamera.world.Entity_HashMap.get("player").getParticle());
    mainCamera.iterate();
    mainCamera.entityDrag(); // Deals with dragging points

    // Update the physics
    updateWorld(worldOne);

    // Rendering and stuff
    Render.testResize();

    FrameBufferObject.setFrameBuffer(
        extra_frame.getFrameBufferIdentifier()); // applies the extra framebuffer
    mainCamera.render();
    FrameBufferObject.setFrameBuffer(0); // applies the normal screen

    // Drawing the framebuffer
    HUDShapes.drawTexturedQuad(
        0,
        0,
        Display.getWidth(),
        Display.getHeight(),
        extra_frame.getTexture(),
        Display.getWidth(),
        Display.getHeight());
    Display.update();
  }
Example #8
0
 @Override
 public Component getTableCellRendererComponent(
     JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
   r.disk = (Disk) value;
   return r;
 }
  public static void main(final String[] args) {

    //        String mf;
    //        String molfile;

    try {
      //            BufferedReader reader = new BufferedReader(new FileReader("renderTest.mol"));
      //            StringBuffer   sbuff  = new StringBuffer();
      //            String         line;
      //
      //            while ( (line = reader.readLine()) != null ) {
      //                sbuff.append(line + "\n");
      //            }
      //            reader.close();
      //            molfile = sbuff.toString();
      //            System.out.println(molfile);

      // the graph
      SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
      PubChemWebService pw = new PubChemWebService();
      String PCID = "1148";
      IAtomContainer container = pw.getSingleMol(PCID);
      container = AtomContainerManipulator.removeHydrogens(container);
      //            IAtomContainer container = sp.parseSmiles("OC1C(O)=COC(CO)C1(O)");

      // Render.Draw(container, "test");

      IMolecule test = new Molecule(container);
      StructureDiagramGenerator sdg = new StructureDiagramGenerator();
      sdg.setMolecule(test);
      sdg.generateCoordinates();
      IMolecule mol = sdg.getMolecule();

      // adds implicit H atoms to molecule
      //    		CDKAtomTypeMatcher matcher = CDKAtomTypeMatcher.getInstance(mol.getBuilder());
      //    		for (IAtom atom : mol.atoms()) {
      //    			IAtomType type = matcher.findMatchingAtomType(mol, atom);
      //	    		AtomTypeManipulator.configure(atom, type);
      //			}
      //
      //    		CDKHydrogenAdder adder = CDKHydrogenAdder.getInstance(mol.getBuilder());
      //    		adder.addImplicitHydrogens(mol);
      //    		AtomContainerManipulator.convertImplicitToExplicitHydrogens(mol);

      // detects aromaticity; used to display aromatic ring systems correctly
      CDKHueckelAromaticityDetector.detectAromaticity(mol);

      Render.Draw(mol, "test");

      DisplayStructureVector test12 =
          new DisplayStructureVector(200, 200, "/home/swolf/", true, true);
      // test12.writeMOL2PNGFile(mol, "test_cdk12.png");
      //    		test12.writeMOL2PDFFile(mol, new File("/home/swolf/test_cdk12.pdf"));
      test12.writeMOL2SVGFile(mol, new File("/home/swolf/" + PCID + ".svg"));

      // ChemRenderer crender = new ChemRenderer();
      // crender.writeMOL2PNGFile(mol, new File("/home/swolf/test_new.png"));
      // crender.writeMOL2EPSFile(mol, new File("/home/swolf/test_new.eps"));
      // crender.writeMOL2PDFFile(mol, new File("/home/swolf/test_new.pdf"));

      // crender.writeMOL2SVGFile(molfile,new File("Output.svg"));

    } catch (Exception e) {
      System.out.println("Error: " + e.getMessage() + ".");
      e.printStackTrace();
    }
  }
Example #10
0
  private RenderManager() {
    this.entityRenderMap.put(EntitySpider.class, new RenderSpider());
    this.entityRenderMap.put(EntityCaveSpider.class, new RenderSpider());
    this.entityRenderMap.put(
        EntityPig.class, new RenderPig(new ModelPig(), new ModelPig(0.5F), 0.7F));
    this.entityRenderMap.put(
        EntitySheep.class, new RenderSheep(new ModelSheep2(), new ModelSheep1(), 0.7F));
    this.entityRenderMap.put(EntityCow.class, new RenderCow(new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityMooshroom.class, new RenderMooshroom(new ModelCow(), 0.7F));
    this.entityRenderMap.put(EntityWolf.class, new RenderWolf(new ModelWolf(), 0.5F));
    this.entityRenderMap.put(EntityChicken.class, new RenderChicken(new ModelChicken(), 0.3F));
    this.entityRenderMap.put(EntityOcelot.class, new RenderOcelot(new ModelOcelot(), 0.4F));
    this.entityRenderMap.put(EntitySilverfish.class, new RenderSilverfish());
    this.entityRenderMap.put(EntityCreeper.class, new RenderCreeper());
    this.entityRenderMap.put(EntityEnderman.class, new RenderEnderman());
    this.entityRenderMap.put(EntitySnowman.class, new RenderSnowMan());
    this.entityRenderMap.put(EntitySkeleton.class, new RenderBiped(new ModelSkeleton(), 0.5F));
    this.entityRenderMap.put(EntityBlaze.class, new RenderBlaze());
    this.entityRenderMap.put(EntityZombie.class, new RenderBiped(new ModelZombie(), 0.5F));
    this.entityRenderMap.put(
        EntitySlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F));
    this.entityRenderMap.put(EntityMagmaCube.class, new RenderMagmaCube());
    this.entityRenderMap.put(EntityPlayer.class, new RenderPlayer());
    this.entityRenderMap.put(
        EntityGiantZombie.class, new RenderGiantZombie(new ModelZombie(), 0.5F, 6.0F));
    this.entityRenderMap.put(EntityGhast.class, new RenderGhast());
    this.entityRenderMap.put(EntitySquid.class, new RenderSquid(new ModelSquid(), 0.7F));
    this.entityRenderMap.put(EntityVillager.class, new RenderVillager());
    this.entityRenderMap.put(EntityIronGolem.class, new RenderIronGolem());
    this.entityRenderMap.put(EntityLiving.class, new RenderLiving(new ModelBiped(), 0.5F));
    this.entityRenderMap.put(EntityDragon.class, new RenderDragon());
    this.entityRenderMap.put(EntityEnderCrystal.class, new RenderEnderCrystal());
    this.entityRenderMap.put(Entity.class, new RenderEntity());
    this.entityRenderMap.put(EntityPainting.class, new RenderPainting());
    this.entityRenderMap.put(EntityArrow.class, new RenderArrow());
    this.entityRenderMap.put(
        EntitySnowball.class, new RenderSnowball(Item.snowball.getIconFromDamage(0)));
    this.entityRenderMap.put(
        EntityEnderPearl.class, new RenderSnowball(Item.enderPearl.getIconFromDamage(0)));
    this.entityRenderMap.put(
        EntityEnderEye.class, new RenderSnowball(Item.eyeOfEnder.getIconFromDamage(0)));
    this.entityRenderMap.put(EntityEgg.class, new RenderSnowball(Item.egg.getIconFromDamage(0)));
    this.entityRenderMap.put(EntityPotion.class, new RenderSnowball(154));
    this.entityRenderMap.put(
        EntityExpBottle.class, new RenderSnowball(Item.expBottle.getIconFromDamage(0)));
    this.entityRenderMap.put(EntityFireball.class, new RenderFireball(2.0F));
    this.entityRenderMap.put(EntitySmallFireball.class, new RenderFireball(0.5F));
    this.entityRenderMap.put(EntityItem.class, new RenderItem());
    this.entityRenderMap.put(EntityXPOrb.class, new RenderXPOrb());
    this.entityRenderMap.put(EntityTNTPrimed.class, new RenderTNTPrimed());
    this.entityRenderMap.put(EntityFallingSand.class, new RenderFallingSand());
    this.entityRenderMap.put(EntityMinecart.class, new RenderMinecart());
    this.entityRenderMap.put(EntityBoat.class, new RenderBoat());
    this.entityRenderMap.put(EntityFishHook.class, new RenderFish());
    this.entityRenderMap.put(EntityLightningBolt.class, new RenderLightningBolt());
    ModLoader.addAllRenderers(this.entityRenderMap);
    Iterator var1 = this.entityRenderMap.values().iterator();

    while (var1.hasNext()) {
      Render var2 = (Render) var1.next();
      var2.setRenderManager(this);
    }
  }