Examples of IRule


Examples of ch.bfh.jass.interfaces.IRule

        team2.add(player3);
        team2.add(player4);
        teams.add(team1);
        teams.add(team2);
      
        IRule rule = new JassRule();

        Assert.assertTrue(rule.hasWinner(teams));
    }
View Full Code Here

Examples of ch.bfh.jass.interfaces.IRule

        team2.add(player3);
        team2.add(player4);
        teams.add(team1);
        teams.add(team2);

        IRule rule = new JassRule();
       
        Assert.assertEquals(player2, rule.getWinner(teams).get(0));
        Assert.assertEquals(player4, rule.getWinner(teams).get(1));
    }
View Full Code Here

Examples of ch.bfh.jass.interfaces.IRule

        Assert.assertEquals(player4, rule.getWinner(teams).get(1));
    }
   
    @Test
    public void testSortCards(){
        IRule rule = new JassRule();
        Hand hand = rule.getHand();
       
        for(Card card : hand.getCards()){
            System.out.println(card.getRank());
        }
    }
View Full Code Here

Examples of com.salas.bb.views.stylesheets.domain.IRule

        String text = "~ { font: bold; }";
        Map rules = Parser.parseRules(text);

        assertEquals(1, rules.size());

        IRule rule = (IRule)rules.get("~");
        assertNotNull(rule);
        assertTrue(rule.getFont().isBold());
    }
View Full Code Here

Examples of com.salas.bb.views.stylesheets.domain.IRule

        String text = "el { font: bold; }";
        Map rules = Parser.parseRules(text);

        assertEquals(1, rules.size());

        IRule rule = (IRule)rules.get("el");
        assertNotNull(rule);
        assertTrue(rule.getFont().isBold());
    }
View Full Code Here

Examples of com.salas.bb.views.stylesheets.domain.IRule

        String text = "el.cl { font: bold; }";
        Map rules = Parser.parseRules(text);

        assertEquals(1, rules.size());

        IRule rule = (IRule)rules.get("el.cl");
        assertNotNull(rule);
        assertTrue(rule.getFont().isBold());
    }
View Full Code Here

Examples of com.salas.bb.views.stylesheets.domain.IRule

        String text = ".cl { font: bold; }";
        Map rules = Parser.parseRules(text);

        assertEquals(1, rules.size());

        IRule rule = (IRule)rules.get(".cl");
        assertNotNull(rule);
        assertTrue(rule.getFont().isBold());
    }
View Full Code Here

Examples of com.salas.bb.views.stylesheets.domain.IRule

            "el.cl { color: #000004; }";
        Map rules = Parser.parseRules(text);

        assertEquals(4, rules.size());

        IRule rule;
        rule = (IRule)rules.get("~");
        assertTrue(rule.getColor().equals(Color.decode("#000001")));

        rule = (IRule)rules.get("el");
        assertTrue(rule.getColor().equals(Color.decode("#000002")));

        rule = (IRule)rules.get(".cl");
        assertTrue(rule.getColor().equals(Color.decode("#000003")));

        rule = (IRule)rules.get("el.cl");
        assertTrue(rule.getColor().equals(Color.decode("#000004")));
    }
View Full Code Here

Examples of com.salas.bb.views.stylesheets.domain.IRule

            String[] tags = new String[0]; // TODO fetch tags

            panel.setBackground(isSelected ? getSelectionBackground() : getBackground());
            box.setBackground(isSelected ? getSelectionBackground() : getBackground());

            IRule rule = stylesheet.getRule(el, tags);
            if (rule != null)
            {
                // Update font
                Font fnt = rule.getFont();
                boolean bold = fnt != null && fnt.isBold();
                if (defFont.isBold() != bold) setFont(defFont.deriveFont(bold ? Font.BOLD : Font.PLAIN));

                // Update color
                if (!isSelected)
                {
                    Color color = rule.getColor();
                    if (color == null) color = Color.BLACK;
                    setForeground(color);
                }

                // Assign icon
                Icon icon = rule.getIcon();
                setIcon(icon);
            }

//            checkbox.setFocusPainted(false);
//            checkbox.setBorderPainted(true);
View Full Code Here

Examples of com.salas.bb.views.stylesheets.domain.IRule

                panel.add(box, cc.xy(1, 1));
                box.setSelected(node.isSelected());
                if (!leafFolders) el = "item";
            }

            IRule rule = getRule(el, tags);
            if (rule != null)
            {
                // Update font
                Font fnt = rule.getFont();
                boolean bold = fnt != null && fnt.isBold();

                Font curFont = getFont();
                if (curFont.isBold() != bold) setFont(curFont.deriveFont(bold ? Font.BOLD : Font.PLAIN));

                // Update color
                if (!sel)
                {
                    Color color = rule.getColor();
                    if (color == null) color = Color.BLACK;
                    setForeground(color);
                }

                // Assign icon
                Icon icon = rule.getIcon();
                setIcon(icon);
                setClosedIcon(icon);
                setOpenIcon(icon);
                setLeafIcon(icon);
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.