@Override
    public void keyPressed(KeyEvent e) {
        if(e.getKeyCode()==45 && currentScale>0){
            currentScale--;
            scale.setScale(availableScales.get(currentScale));
        }
        if(e.getKeyCode()==521 && currentScale<availableScales.size()-1){
            currentScale++;
            scale.setScale(availableScales.get(currentScale));
        }
        if(e.getKeyCode()==37){
            scale.setOriginX(scale.getOriginX()+scale.getScale());
        }else if(e.getKeyCode()==39){
            scale.setOriginX(scale.getOriginX()-scale.getScale());
        }else if(e.getKeyCode()==40){
            scale.setOriginY(scale.getOriginY()-scale.getScale());
        }else if(e.getKeyCode()==38){
            scale.setOriginY(scale.getOriginY()+scale.getScale());
        }
        piirtoalusta.repaint();
    }