Package net.sf.latexdraw.glib.views.Java2D.interfaces

Examples of net.sf.latexdraw.glib.views.Java2D.interfaces.IViewText



  @SuppressWarnings("unused")
  @Test
  public void testNewTwoSameTextsNewSinglePicture() throws InterruptedException {
    IViewText v2 = (IViewText)View2DTK.getFactory().createView(ShapeFactory.createText(ShapeFactory.createPoint(), "coucou")); //$NON-NLS-1$
    assertEquals(1, FlyweightThumbnail.images().size());
    Option<Tuple4<Image,Set<IViewText>,String,String>> optTuple = FlyweightThumbnail.images().get(((IText)viewTxt.getShape()).getLineColour()+((IText)viewTxt.getShape()).getText());
    assertTrue(optTuple.isDefined());
    assertEquals(2, optTuple.get()._2().size());
  }
View Full Code Here




  @Test
  public void testNewTwoSameTextsRemoveOneStillPicture() {
    IViewText v2 = (IViewText)View2DTK.getFactory().createView(ShapeFactory.createText(ShapeFactory.createPoint(), "coucou")); //$NON-NLS-1$
    FlyweightThumbnail.notifyImageFlushed(viewTxt, ((IText)viewTxt.getShape()).getText(), ((IText)viewTxt.getShape()).getLineColour());
    assertEquals(1, FlyweightThumbnail.images().size());
    Option<Tuple4<Image,Set<IViewText>,String,String>> optTuple = FlyweightThumbnail.images().get(((IText)v2.getShape()).getLineColour()+((IText)v2.getShape()).getText());
    assertTrue(optTuple.isDefined());
    assertEquals(1, optTuple.get()._2().size());
    assertEquals(v2, optTuple.get()._2().last());
  }
View Full Code Here

  }


  @Test
  public void testNewTwoTextsRemoveOneOnePictureRemains() {
    IViewText v2 = (IViewText)View2DTK.getFactory().createView(ShapeFactory.createText(ShapeFactory.createPoint(), "aaa")); //$NON-NLS-1$
    assertEquals(2, FlyweightThumbnail.images().size());
    FlyweightThumbnail.notifyImageFlushed(viewTxt, ((IText)viewTxt.getShape()).getText(), ((IText)viewTxt.getShape()).getLineColour());
    assertEquals(1, FlyweightThumbnail.images().size());
    Option<Tuple4<Image,Set<IViewText>,String,String>> optTuple = FlyweightThumbnail.images().get(((IText)v2.getShape()).getLineColour()+((IText)v2.getShape()).getText());
    assertTrue(optTuple.isDefined());
    assertEquals(1, optTuple.get()._2().size());
    assertEquals(v2, optTuple.get()._2().last());
  }
View Full Code Here

TOP

Related Classes of net.sf.latexdraw.glib.views.Java2D.interfaces.IViewText

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.