Package factOrFiction.model

Examples of factOrFiction.model.CardTemplateAdapter


      protected void measure(Event event, Object element) {
        CardTemplate card = CardPool.instance().lookup((Document)element);
        if (card == null || !(card instanceof CardTemplateAdapter))
          return;
       
        CardTemplateAdapter adapter = (CardTemplateAdapter)card;
        event.width = CardTemplate.MANA_SYMBOL_SIZE * adapter.getManaSymbolCount();
        event.height = Math.max(event.height, CardTemplate.MANA_SYMBOL_SIZE + 2);
      }

      @Override
      protected void paint(Event event, Object element) {
        Document doc = (Document)element;
        CardTemplate card = CardPool.instance().lookup(doc);

        TableItem  item = (TableItem ) event.item;
       
        if (card == null || item == null || !(card instanceof CardTemplateAdapter))
          return;

        CardTemplateAdapter adapter = (CardTemplateAdapter)card;
        Image image = adapter.getCastingCost();
        if (image != null) {
          Rectangle imagebounds = image.getBounds();
          Rectangle bounds = item.getBounds(event.index);
         
          int x = event.x + bounds.width - imagebounds.width;           
View Full Code Here


        loader.load( imageURL.openStream() );
       
        Image image  = new Image( Display.getCurrent(), loader.data[0] );
 
        if (card instanceof CardTemplateAdapter) {
          CardTemplateAdapter adapter = (CardTemplateAdapter) card;
          adapter.setImage(image);
        }
       
        IPath savePath = card.getStateLocation();
        savePath = savePath.append("cached");
              savePath.toFile().mkdirs();
View Full Code Here

TOP

Related Classes of factOrFiction.model.CardTemplateAdapter

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.