Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change deprecated ModellingApp usage class to ArtOfIllusion #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/artofillusion/tapDesigner/ProcPanelLayout.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2004 by Francois Guillet
* Changes copyright (C) 2021 by Maksim Khramov
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later version.
Expand All @@ -13,7 +14,6 @@
import artofillusion.*;
import buoy.widget.*;
import java.io.*;
import java.util.*;
import java.lang.reflect.*;

//}}}
Expand Down Expand Up @@ -239,7 +239,7 @@ public ProcPanelLayout( DataInputStream in )

try
{
Class cls = ModellingApp.getClass( classname );
Class cls = ArtOfIllusion.getClass( classname );
if ( cls == null )
throw new IOException( "Unknown class: " + classname );

Expand Down
15 changes: 6 additions & 9 deletions src/artofillusion/tapDesigner/TapDesignerTool.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

/*
* Copyright 2003 Francois Guillet
* Changes copyright (C) 2021 by Maksim Khramov
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later version.
Expand All @@ -11,9 +12,7 @@
package artofillusion.tapDesigner;

import artofillusion.*;
import artofillusion.ui.*;
import java.util.*;
import artofillusion.tapDesigner.*;

/**
*@author pims
Expand All @@ -22,22 +21,19 @@

public class TapDesignerTool implements ModellingTool
{
/**
* instance this tool,load it in memory
*/

public TapDesignerTool() { }


/**
* Get the text that appear as the menu item.
*
*@return The name value
*/
@Override
public String getName()
{
TapBTranslate.setLocale( ModellingApp.getPreferences().getLocale() );
TapDesignerTranslate.setLocale( ModellingApp.getPreferences().getLocale() );
Locale locale = ArtOfIllusion.getPreferences().getLocale();
TapBTranslate.setLocale(locale);
TapDesignerTranslate.setLocale(locale);
return TapBTranslate.text( "tapDesignerTitle" );
//return "Tree and Plant Designer";
}
Expand All @@ -49,6 +45,7 @@ public String getName()
*
*@param window Description of the Parameter
*/
@Override
public void commandSelected( LayoutWindow window )
{
new TapFrame( window, null );
Expand Down
4 changes: 2 additions & 2 deletions src/artofillusion/tapDesigner/TapFrame.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* Copyright 2003 Francois Guillet
Changes copyright (C) 2020 by Maksim Khramov
Changes copyright (C) 2020-2021 by Maksim Khramov

* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -466,7 +466,7 @@ public void pasteAsObjects()
TapProcedure procedure = procPanel.getProcedure();
TapDesignerObjectCollection collection = procedure.getObject();
ObjectInfo[] objects = collection.getAoIObjects();
ModellingApp.copyToClipboard( objects, procedure.getScene() );
ArtOfIllusion.copyToClipboard( objects, procedure.getScene() );
window.updateMenus();
}

Expand Down
6 changes: 3 additions & 3 deletions src/artofillusion/tapDesigner/TapProcedure.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
/*
* Copyright (C) 2003 by Francois Guillet
* Changes copyright (C) 2019 by Maksim Khramov
* Changes copyright (C) 2019-2021 by Maksim Khramov
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -840,7 +840,7 @@ public TapProcedure( DataInputStream in, Scene sc )
if ( ( version < 0 ) || ( version > 3 ) )
throw new InvalidObjectException( "" );

TapBTranslate.setLocale( ModellingApp.getPreferences().getLocale() );
TapBTranslate.setLocale( ArtOfIllusion.getPreferences().getLocale() );
seed = in.readLong();
renderingLevel = in.readInt();
viewLevel = in.readInt();
Expand All @@ -857,7 +857,7 @@ public TapProcedure( DataInputStream in, Scene sc )
byte[] bytes = new byte[len];
in.readFully( bytes );

Class cls = ModellingApp.getClass( classname );
Class cls = ArtOfIllusion.getClass( classname );

try
{
Expand Down
13 changes: 5 additions & 8 deletions src/artofillusion/tapDesigner/modules/TapModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,25 @@
*/
/*
* Copyright (C) 2003 by Francois Guillet
* Changes copyright (C) 2021 by Maksim Khramov
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*/

package artofillusion.tapDesigner;

import artofillusion.*;
import artofillusion.animation.*;
import artofillusion.math.*;
import artofillusion.object.*;
import artofillusion.texture.*;
import artofillusion.tapDesigner.*;
import artofillusion.ui.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.lang.reflect.*;
import java.util.*;
import javax.swing.*;
import buoy.event.*;
import buoy.widget.*;


Expand Down Expand Up @@ -957,7 +953,7 @@ public Scene getScene( ObjectInfo object )
{
// set up a new temporary scene
Scene previewScene = new Scene();
CoordinateSystem coords = new CoordinateSystem( new Vec3( 0.0, 0.0, ModellingApp.DIST_TO_SCREEN ), new Vec3( 0.0, 0.0, -1.0 ), Vec3.vy() );
CoordinateSystem coords = new CoordinateSystem( new Vec3( 0.0, 0.0, Camera.DEFAULT_DISTANCE_TO_SCREEN ), new Vec3( 0.0, 0.0, -1.0 ), Vec3.vy() );
ObjectInfo info;

info = new ObjectInfo( new SceneCamera(), coords, "Camera 1" );
Expand Down Expand Up @@ -1195,7 +1191,7 @@ public void setupPreviewFrame( ObjectInfo anObject )
{
// set up a new temporary scene
Scene previewScene = new Scene();
CoordinateSystem coords = new CoordinateSystem( new Vec3( 0.0, 0.0, ModellingApp.DIST_TO_SCREEN ), new Vec3( 0.0, 0.0, -1.0 ), Vec3.vy() );
CoordinateSystem coords = new CoordinateSystem( new Vec3( 0.0, 0.0, Camera.DEFAULT_DISTANCE_TO_SCREEN ), new Vec3( 0.0, 0.0, -1.0 ), Vec3.vy() );
ObjectInfo info;

info = new ObjectInfo( new SceneCamera(), coords, "Camera 1" );
Expand Down Expand Up @@ -1226,6 +1222,7 @@ public void setupPreviewFrame( ObjectInfo anObject )
*
*@return String representation of the module, equivalent to getName()
*/
@Override
public String toString()
{
return getName();
Expand Down